Technical information
SCI to SPI Peripheral Communication in V850ES Microcontrollers
/* CSI00 Transmission */
UCHAR *CSI00_TX_ADDRESS; /* csi00 transmit buffer address */
USHORT CSI00_TX_CNT; /* csi00 transmit data number */
USHORT CSI00_TX_LEN; /* csi00 transmit data length */
/* CSI00 Reception */
UCHAR *CSI00_RX_ADDRESS;
USHORT CSI00_RX_LEN; /* csi00 recive buffer size */
USHORT CSI00_RX_CNT; /* csi00 recive data count */
#define FIX_APPLILET_CSI00_ISR 1 /* define to fix code */
/*
**---------------------------------------------------------------------------
--------------------------------
**
** Abstract:
** CSI00 interface initialization, the application is responsible for
** set work mode, transfer speed, data bit length, data direction setting,
** automatic transfer mode,clock and data phase setting,INTCSI00 parity
** setting.
**
** Parameters:
** None
**
** Returns:
** None
**
**---------------------------------------------------------------------------
--------------------------------
*/
void CSI00_Init( void )
{
CSIM00 = 0;
SetIORBit(CSI0IC0, 0x40); /* Interrupt disabled */
SetIORBit(PMC4, 0x07); /* Port setting for
receive/transmit mode*/
ClrIORBit(CSIM00, 0x20); /* Set data length is 8 bits */
ClrIORBit(CSIM00, 0x10); /* Set data direction is MSB */
SetIORBit(CSIC0, 0x10); /* Clock data phase3 */
SetIORBit(CSIC0, 0x01); /* fxx/4 */
SetIORBit(CSI0IC0, Lowest); /* Set transfer completion
interrupt priority Lowest */
ClrIORBit(CSI0IC0, 0x40);
SetIORBit(CSIM00, 0x40); /* CSI00 work in half-duplex mode
*/
SetIORBit(CSIM00, 0x80);
return;
}
/*
63