1 /* 2 ******************************************************************************* 3 * Copyright(C) NEC Electronics Corporation 2010 4 * All rights reserved by NEC Electronics Corporation. 5 * This program should be used on your own responsibility. 6 * NEC Electronics Corporation assumes no responsibility for any losses 7 * incurred by customers or third parties arising from the use of this file. 8 * 9 * This device driver was created by Applilet3 for V850ES/Jx3 10 * 32-Bit Single-Chip Microcontrollers 11 * Filename: CG_macrodriver.h 12 * Abstract: This file implements general head file. 13 * APIlib: Applilet3 for V850ES/Jx3 V2.01 [20 Apr 2010] 14 * Device: uPD70F3746 15 * Compiler: IAR Systems ICCV850 16 * Creation date: 6/26/2010 17 ******************************************************************************* 18 */ 19 20 #ifndef _MDSTATUS_ 21 #define _MDSTATUS_ 22 /* 23 ******************************************************************************* 24 ** Include files 25 ******************************************************************************* 26 */ 27 #include <intrinsics.h> 28 #include "io70f3454.h" 29 /* 30 ******************************************************************************* 31 ** Register bit define 32 ******************************************************************************* 33 */ 34 /* 35 ******************************************************************************* 36 ** Macro define 37 ******************************************************************************* 38 */ 39 #define DI __disable_interrupt 40 #define EI __enable_interrupt 41 #define NOP __no_operation 42 #define HALT __halt 43 44 /* Data type defintion */ 45 typedef unsigned long ULONG; 46 typedef signed long SLONG; 47 48 typedef unsigned int UINT; 49 typedef signed int SINT; 50 51 typedef unsigned short USHORT; 52 typedef signed short SHORT; 53 54 typedef unsigned char UCHAR; 55 typedef signed char SCHAR; 56 57 typedef unsigned char BOOL; 58 typedef unsigned short MD_STATUS; 59 60 #define MD_ON 1U 61 #define MD_OFF 0U 62 63 #define MD_TRUE 1U 64 #define MD_FALSE 0U 65 66 #define MD_SET 1U 67 #define MD_CLEAR 0U 68 69 /* Status list definition */ 70 #define MD_STATUSBASE 0x00U 71 #define MD_OK (MD_STATUSBASE + 0x00U) /* register setting OK */ 72 #define MD_RESET (MD_STATUSBASE + 0x01U) /* reset input */ 73 #define MD_SENDCOMPLETE (MD_STATUSBASE + 0x02U) /* send data complete */ 74 #define MD_ADDRESSMATCH (MD_STATUSBASE + 0x03U) /* IIC slave address match */ 75 #define MD_OVF (MD_STATUSBASE + 0x04U) /* timer count overflow */ 76 #define MD_SPT (MD_STATUSBASE + 0x07U) /* IIC stop */ 77 #define MD_NACK (MD_STATUSBASE + 0x08U) /* IIC no ACK */ 78 #define MD_SLAVE_SEND_END (MD_STATUSBASE + 0x09U) /* IIC slave send end */ 79 #define MD_SLAVE_RCV_END (MD_STATUSBASE + 0x0AU) /* IIC slave receive end */ 80 #define MD_MASTER_SEND_END (MD_STATUSBASE + 0x0BU) /* IIC master send end */ 81 #define MD_MASTER_RCV_END (MD_STATUSBASE + 0x0CU) /* IIC master receive end */ 82 #define MD_UNDEREXEC (MD_STATUSBASE + 0x0DU) /* DMA transfer under execute */ 83 #define MD_COMPLETED (MD_STATUSBASE + 0x0EU) /* DMA transfer completed */ 84 #define MD_BUSY1 (MD_STATUSBASE + 0x0FU) /* busy 1 */ 85 #define MD_BUSY2 (MD_STATUSBASE + 0x10U) /* busy 2 */ 86 87 /* Error list definition */ 88 #define MD_ERRORBASE 0x80U 89 #define MD_ERROR (MD_ERRORBASE + 0x00U) /* error */ 90 #define MD_RESOURCEERROR (MD_ERRORBASE + 0x01U) /* no resource available */ 91 #define MD_PARITYERROR (MD_ERRORBASE + 0x02U) /* UARTn parity error n=0,1,2 */ 92 #define MD_OVERRUNERROR (MD_ERRORBASE + 0x03U) /* UARTn overrun error n=0,1,2 */ 93 #define MD_FRAMEERROR (MD_ERRORBASE + 0x04U) /* UARTn frame error n=0,1,2 */ 94 #define MD_ARGERROR (MD_ERRORBASE + 0x05U) /* Error agrument input error */ 95 #define MD_TIMINGERROR (MD_ERRORBASE + 0x06U) /* Error timing operation error */ 96 #define MD_SETPROHIBITED (MD_ERRORBASE + 0x07U) /* setting prohibited */ 97 #define MD_ODDBUF (MD_ERRORBASE + 0x08U) /* in 16bit transfer mode,buffer size should be even */ 98 #define MD_DATAEXISTS (MD_ERRORBASE + 0x09U) /* Data to be transferred next exists in TXBn register */ 99 #define MD_STSERROR (MD_ERRORBASE + 0x0AU) /* CAN status error */ 100 #define MD_ALRDYSTART (MD_ERRORBASE + 0x0BU) /* CAN-controller is already started error */ 101 #define MD_NOMSG (MD_ERRORBASE + 0x0CU) /* CAN message not received */ 102 #define MD_ERROR1 (MD_ERRORBASE + 0x0DU) /* error 1 */ 103 #define MD_ERROR2 (MD_ERRORBASE + 0x0EU) /* error 2 */ 104 /* 105 ******************************************************************************* 106 ** Function define 107 ******************************************************************************* 108 */ 109 110 #endif 111