CG_macrodriver.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. #ifndef _MDSTATUS_
  20. #define _MDSTATUS_
  21. /*
  22. *******************************************************************************
  23. ** Include files
  24. *******************************************************************************
  25. */
  26. #include <intrinsics.h>
  27. #include "io70f3454.h"
  28. /*
  29. *******************************************************************************
  30. ** Register bit define
  31. *******************************************************************************
  32. */
  33. /*
  34. *******************************************************************************
  35. ** Macro define
  36. *******************************************************************************
  37. */
  38. #define DI __disable_interrupt
  39. #define EI __enable_interrupt
  40. #define NOP __no_operation
  41. #define HALT __halt
  42. /* Data type defintion */
  43. typedef unsigned long ULONG;
  44. typedef signed long SLONG;
  45. typedef unsigned int UINT;
  46. typedef signed int SINT;
  47. typedef unsigned short USHORT;
  48. typedef signed short SHORT;
  49. typedef unsigned char UCHAR;
  50. typedef signed char SCHAR;
  51. typedef unsigned char BOOL;
  52. typedef unsigned short MD_STATUS;
  53. #define MD_ON 1U
  54. #define MD_OFF 0U
  55. #define MD_TRUE 1U
  56. #define MD_FALSE 0U
  57. #define MD_SET 1U
  58. #define MD_CLEAR 0U
  59. /* Status list definition */
  60. #define MD_STATUSBASE 0x00U
  61. #define MD_OK (MD_STATUSBASE + 0x00U) /* register setting OK */
  62. #define MD_RESET (MD_STATUSBASE + 0x01U) /* reset input */
  63. #define MD_SENDCOMPLETE (MD_STATUSBASE + 0x02U) /* send data complete */
  64. #define MD_ADDRESSMATCH (MD_STATUSBASE + 0x03U) /* IIC slave address match */
  65. #define MD_OVF (MD_STATUSBASE + 0x04U) /* timer count overflow */
  66. #define MD_SPT (MD_STATUSBASE + 0x07U) /* IIC stop */
  67. #define MD_NACK (MD_STATUSBASE + 0x08U) /* IIC no ACK */
  68. #define MD_SLAVE_SEND_END (MD_STATUSBASE + 0x09U) /* IIC slave send end */
  69. #define MD_SLAVE_RCV_END (MD_STATUSBASE + 0x0AU) /* IIC slave receive end */
  70. #define MD_MASTER_SEND_END (MD_STATUSBASE + 0x0BU) /* IIC master send end */
  71. #define MD_MASTER_RCV_END (MD_STATUSBASE + 0x0CU) /* IIC master receive end */
  72. #define MD_UNDEREXEC (MD_STATUSBASE + 0x0DU) /* DMA transfer under execute */
  73. #define MD_COMPLETED (MD_STATUSBASE + 0x0EU) /* DMA transfer completed */
  74. #define MD_BUSY1 (MD_STATUSBASE + 0x0FU) /* busy 1 */
  75. #define MD_BUSY2 (MD_STATUSBASE + 0x10U) /* busy 2 */
  76. /* Error list definition */
  77. #define MD_ERRORBASE 0x80U
  78. #define MD_ERROR (MD_ERRORBASE + 0x00U) /* error */
  79. #define MD_RESOURCEERROR (MD_ERRORBASE + 0x01U) /* no resource available */
  80. #define MD_PARITYERROR (MD_ERRORBASE + 0x02U) /* UARTn parity error n=0,1,2 */
  81. #define MD_OVERRUNERROR (MD_ERRORBASE + 0x03U) /* UARTn overrun error n=0,1,2 */
  82. #define MD_FRAMEERROR (MD_ERRORBASE + 0x04U) /* UARTn frame error n=0,1,2 */
  83. #define MD_ARGERROR (MD_ERRORBASE + 0x05U) /* Error agrument input error */
  84. #define MD_TIMINGERROR (MD_ERRORBASE + 0x06U) /* Error timing operation error */
  85. #define MD_SETPROHIBITED (MD_ERRORBASE + 0x07U) /* setting prohibited */
  86. #define MD_ODDBUF (MD_ERRORBASE + 0x08U) /* in 16bit transfer mode,buffer size should be even */
  87. #define MD_DATAEXISTS (MD_ERRORBASE + 0x09U) /* Data to be transferred next exists in TXBn register */
  88. #define MD_STSERROR (MD_ERRORBASE + 0x0AU) /* CAN status error */
  89. #define MD_ALRDYSTART (MD_ERRORBASE + 0x0BU) /* CAN-controller is already started error */
  90. #define MD_NOMSG (MD_ERRORBASE + 0x0CU) /* CAN message not received */
  91. #define MD_ERROR1 (MD_ERRORBASE + 0x0DU) /* error 1 */
  92. #define MD_ERROR2 (MD_ERRORBASE + 0x0EU) /* error 2 */
  93. /*
  94. *******************************************************************************
  95. ** Function define
  96. *******************************************************************************
  97. */
  98. #endif