Technical information

SCI to SPI Peripheral Communication in V850ES Microcontrollers
File Function
Timer.h Header file for timer.c
Timer.c Timer 00 functions
Timer_user.c User code for INTTM000 interrupt
850.dir Link directive file
2.7.7 Applilet-Generated Files for CSI00 Operation
The code generated for CSI00 support are in the files serial.h, serial.c, and serial_user.c. These
contain the following items.
2.7.7.1 Serial.h
The header file serial.h contains definitions for the CSI00 functions. The header file macrodriver.h,
used for all Applilet generated code, also defines some data types and values, such as the
MD_STATUS values returned by some functions.
2.7.7.2 Serial.c
The source file serial.c contains the following functions generated by Applilet:
1. void CSI00_Init( void ): Initializes the CSI00 peripheral as specified in the Applilet CSI00
dialog;
2. MD_STATUS CSI00_SendData( UCHAR* txbuf, UCHAR txnum ): Sets up a transmit
operation of txnum characters from the txbuf buffer; will also start the transmission operation
by sending the first byte to the SOTB0L register
3. MD_STATUS CSI00_ReceiveData( UCHAR* rxbuf, UCHAR rxnum ): Sets up a receive
operation, requesting rxnum characters be received to the rxbuf buffer. This routine does not
start a CSI00 transfer operation; reception is started by calling CSI00_SendData() to send
bytes.
4. __interrupt void MD_INTCSI00( void ): The interrupt service routine for the CSI00 interrupt
INTCSI00. For transmit operations, sends the next data and increments the count; when done,
calls the CALL_CSI00_Send() callback routine. For receive operations, stores the received
data to the receive buffer and increments the count.
2.7.7.3 Serial_user.c
The source file serial_user.c contains stub functions for user code. These functions are empty on
code generation, to allow the user to add application-specific code.
1. void CALL_CSI00_Send( void ): This routine is called when a transmission is complete.
Code was added here to set a flag, CSI11_SendDone, to indicate to the main program that
transmit is complete.
35