Exemple #1
0
void send_td(sio2_transfer_data_t *td)
{
	int i;

#ifndef XSIO2MAN
	log_default(LOG_TRS);
#endif

	for (i = 0; i < 4; i++) {
		sio2_portN_ctrl1_set(i, td->port_ctrl1[i]);
		sio2_portN_ctrl2_set(i, td->port_ctrl2[i]);
	}

#ifndef XSIO2MAN
	log_portdata(td->port_ctrl1, td->port_ctrl2);
#endif

	for (i = 0; i < 16; i++)
		sio2_regN_set(i, td->regdata[i]);

#ifndef XSIO2MAN
	log_regdata(td->regdata);
#endif

	if (td->in_size) {
		for (i = 0; i < td->in_size; i++)
			sio2_data_out(td->in[i]);
	#ifndef XSIO2MAN
		log_data(LOG_TRS_DATA, td->in, td->in_size);
	#endif
	}

	if (td->in_dma.addr) {
		dmac_request(IOP_DMAC_SIO2in, td->in_dma.addr, td->in_dma.size,
				td->in_dma.count, DMAC_FROM_MEM);
		dmac_transfer(IOP_DMAC_SIO2in);

	#ifndef XSIO2MAN
		log_dma(LOG_TRS_DMA_IN, &td->in_dma);
	#endif
	}

	if (td->out_dma.addr) {
		dmac_request(IOP_DMAC_SIO2out, td->out_dma.addr, td->out_dma.size,
				td->out_dma.count, DMAC_TO_MEM);
		dmac_transfer(IOP_DMAC_SIO2out);

	#ifndef XSIO2MAN
		log_dma(LOG_TRS_DMA_OUT, &td->out_dma);
	#endif
	}
}
Exemple #2
0
static void _Send ( SIO2_TransferData* apData ) {

 int i;

 for ( i = 0; i < 4; ++i ) {

  SIO2_SetPortNCtrl1 ( i, apData -> m_PortCtrl1[ i ] );
  SIO2_SetPortNCtrl2 ( i, apData -> m_PortCtrl2[ i ] );

 }  /* end for */

 for ( i = 0; i < 16; ++i ) SIO2_SetReg ( i, apData -> m_Regdata[ i ] );

 for ( i = 0; i < apData -> m_InSize; ++i ) SIO2_DataOut ( apData -> m_pIn[ i ] );

 if ( apData -> m_DMAIn.m_pAddr ) {

  dmac_request (
   IOP_DMAC_SIO2in, apData -> m_DMAIn.m_pAddr, apData -> m_DMAIn.m_Size,
   apData -> m_DMAIn.m_Count, DMAC_FROM_MEM
  );
  dmac_transfer ( IOP_DMAC_SIO2in );

 }  /* end if */

 if ( apData -> m_DMAOut.m_pAddr ) {

  dmac_request (
   IOP_DMAC_SIO2out, apData -> m_DMAOut.m_pAddr, apData -> m_DMAOut.m_Size,
   apData -> m_DMAOut.m_Count, DMAC_TO_MEM
  );
  dmac_transfer ( IOP_DMAC_SIO2out );

 }  /* end if */

}  /* end _Send */