Technical information
SCI to SPI Peripheral Communication in V850ES Microcontrollers
#define MD_MASTER_SEND_END MD_STATUSBASE+0x11 /*IIC master send
end*/
#define MD_MASTER_RCV_END MD_STATUSBASE+0x12 /*IIC master
receive end*/
/*error list definition*/
#define MD_ERRORBASE 0x80
#define MD_ERROR MD_ERRORBASE+0x0 /*error*/
#define MD_RESOURCEERROR MD_ERRORBASE+0x1 /*no resource
available*/
#define MD_PARITYERROR MD_ERRORBASE+0x2 /*UARTn parity error
n=0,1,2*/
#define MD_OVERRUNERROR MD_ERRORBASE+0x3 /*UARTn overrun error
n=0,1,2*/
#define MD_FRAMEERROR MD_ERRORBASE+0x4 /*UARTn frame error
n=0,1,2*/
#define MD_ARGERROR MD_ERRORBASE+0x5 /*Error agrument input
error*/
#define MD_TIMINGERROR MD_ERRORBASE+0x6 /*Error timing
operation error*/
#define MD_SETPROHIBITED MD_ERRORBASE+0x7 /*setting
prohibited*/
#define MD_ODDBUF MD_ERRORBASE+0x8 /*in 16bit transfer
mode,buffer size should be even*/
#define MD_DATAEXISTS MD_ERRORBASE+0x9 /*Data to be
transferred next exists in TXBn register*/
/* macro fucntion definiton */
#define LockInt( ) { __asm("stsr 5,r10"); __asm("push r10"); __asm("di"); }
#define UnlockInt( ) { __asm("pop r10"); __asm("ldsr r10,5"); }
/*main clock and subclock as clock source*/
enum ClockMode { MainClock, SubClock };
void Clock_Init( void );
/*clear IO register bit and set IO register bit */
#define ClrIORBit(Reg, ClrBitMap) Reg &= ~ClrBitMap
#define SetIORBit(Reg, SetBitMap) Reg |= SetBitMap
enum INTLevel{Highest,Level1,Level2,Level3,Level4,Level5,Level6,Lowest};
enum TrigEdge { None, RisingEdge,FallingEdge, BothEdge };
#define SYSTEMCLOCK 20000000
#define SUBCLOCK 32768
#define MAINCLOCK 5000000
#endif
4.2.2 Crte.s
# This device driver was created by Applilet for the V850ES/KX1+
# 32-Bit Single-Chip Microcontrollers
#
# Copyright(C) NEC Electronics Corporation 2002-2004
79