Download Directed Electronics 3200HS Technical information

Transcript
SCI to SPI Peripheral Communication in V850ES Microcontrollers
/* CSI00 Transmission */
UCHAR *CSI00_TX_ADDRESS;
USHORT CSI00_TX_CNT;
USHORT CSI00_TX_LEN;
/* csi00 transmit buffer address */
/* csi00 transmit data number */
/* csi00 transmit data length */
/* CSI00 Reception */
UCHAR *CSI00_RX_ADDRESS;
USHORT CSI00_RX_LEN;
USHORT CSI00_RX_CNT;
/* csi00 recive buffer size */
/* 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);
receive/transmit mode*/
ClrIORBit(CSIM00, 0x20);
ClrIORBit(CSIM00, 0x10);
/* Port setting for
/* Set data length is 8 bits */
/* Set data direction is MSB */
SetIORBit(CSIC0, 0x10);
SetIORBit(CSIC0, 0x01);
SetIORBit(CSI0IC0, Lowest);
interrupt priority Lowest */
/* Clock data phase3 */
/* fxx/4 */
/* Set transfer completion
ClrIORBit(CSI0IC0, 0x40);
SetIORBit(CSIM00, 0x40);
/* CSI00 work in half-duplex mode
*/
SetIORBit(CSIM00, 0x80);
return;
}
/*
63