lpc_can.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. #ifndef _ARCH_CM3_NXP_MACH_LPC_CAN_H_
  2. #define _ARCH_CM3_NXP_MACH_LPC_CAN_H_
  3. /*
  4. * Copyright 2011 by egnite GmbH
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the copyright holders nor the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  23. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  29. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. *
  32. * For additional information see http://www.ethernut.de/
  33. */
  34. /*!
  35. * \file arch/cm3/nxp/mach/lpc_can.h
  36. * \brief LPC CAN definitions
  37. *
  38. * \verbatim
  39. * $Id$
  40. * \endverbatim
  41. */
  42. /*!
  43. * \addtogroup xgNutArchArmv7mLpcUart
  44. */
  45. /*@{*/
  46. /*! \name CAN Register */
  47. /*@{*/
  48. #define CAN_AFMR_OFF 0x00000000
  49. #define CAN_AFMR (LPC_CANAF_BASE + CAN_AFMR_OFF)
  50. /*@}*/
  51. /*! \name CAN Register */
  52. /*@{*/
  53. #define CAN_SFF_SA_OFF 0x00000004
  54. #define CAN_SFF_SA (LPC_CANAF_BASE + CAN_SFF_SA_OFF)
  55. /*@}*/
  56. /*! \name CAN Register */
  57. /*@{*/
  58. #define CAN_SFF_GRP_SA_OFF 0x00000008
  59. #define CAN_SFF_GRP_SA (LPC_CANAF_BASE + CAN_SFF_GRP_SA_OFF)
  60. /*@}*/
  61. /*! \name CAN Register */
  62. /*@{*/
  63. #define CAN_EFF_SA_OFF 0x0000000C
  64. #define CAN_EFF_SA (LPC_CANAF_BASE + CAN_EFF_SA_OFF)
  65. /*@}*/
  66. /*! \name CAN Register */
  67. /*@{*/
  68. #define CAN_EFF_GRP_SA_OFF 0x00000010
  69. #define CAN_EFF_GRP_SA (LPC_CANAF_BASE + CAN_EFF_GRP_SA_OFF)
  70. /*@}*/
  71. /*! \name CAN Register */
  72. /*@{*/
  73. #define CAN_ENDOFTABLE_OFF 0x00000014
  74. #define CAN_ENDOFTABLE (LPC_CANAF_BASE + CAN_ENDOFTABLE_OFF)
  75. /*@}*/
  76. /*! \name CAN Register */
  77. /*@{*/
  78. #define CAN_LUTERRAD_OFF 0x00000018
  79. #define CAN_LUTERRAD (LPC_CANAF_BASE + CAN_LUTERRAD_OFF)
  80. /*@}*/
  81. /*! \name CAN Register */
  82. /*@{*/
  83. #define CAN_LUTERR_OFF 0x0000001C
  84. #define CAN_LUTERR (LPC_CANAF_BASE + CAN_LUTERR_OFF)
  85. /*@}*/
  86. /*! \name CAN Register */
  87. /*@{*/
  88. #define CAN_TXSR_OFF 0x00000000
  89. #define CAN_TXSR (LPC_CANCR_BASE + CAN_TXSR_OFF)
  90. /*@}*/
  91. /*! \name CAN Register */
  92. /*@{*/
  93. #define CAN_RXSR_OFF 0x00000004
  94. #define CAN_RXSR (LPC_CANCR_BASE + CAN_RXSR_OFF)
  95. /*@}*/
  96. /*! \name CAN Registers */
  97. /*@{*/
  98. #define CAN_MSR_OFF 0x00000008
  99. #define CAN_MSR (LPC_CANCR_BASE + CAN_MSR_OFF)
  100. /*@}*/
  101. /*! \name CAN Registers */
  102. /*@{*/
  103. #define CAN_MOD_OFF 0x00000000
  104. /*@}*/
  105. /*! \name CAN Registers */
  106. /*@{*/
  107. #define CAN_CMR_OFF 0x00000004
  108. /*@}*/
  109. /*! \name CAN Registers */
  110. /*@{*/
  111. #define CAN_GSR_OFF 0x00000008
  112. /*@}*/
  113. /*! \name CAN Registers */
  114. /*@{*/
  115. #define CAN_ICR_OFF 0x0000000C
  116. /*@}*/
  117. /*! \name CAN Registers */
  118. /*@{*/
  119. #define CAN_IER_OFF 0x00000010
  120. /*@}*/
  121. /*! \name CAN Registers */
  122. /*@{*/
  123. #define CAN_BTR_OFF 0x00000014
  124. /*@}*/
  125. /*! \name CAN Registers */
  126. /*@{*/
  127. #define CAN_EWL_OFF 0x00000018
  128. /*@}*/
  129. /*! \name CAN Registers */
  130. /*@{*/
  131. #define CAN_SR_OFF 0x0000001C
  132. /*@}*/
  133. /*! \name CAN Registers */
  134. /*@{*/
  135. #define CAN_RFS_OFF 0x00000020
  136. /*@}*/
  137. /*! \name CAN Registers */
  138. /*@{*/
  139. #define CAN_RID_OFF 0x00000024
  140. /*@}*/
  141. /*! \name CAN Registers */
  142. /*@{*/
  143. #define CAN_RDA_OFF 0x00000028
  144. /*@}*/
  145. /*! \name CAN Registers */
  146. /*@{*/
  147. #define CAN_RDB_OFF 0x0000002C
  148. /*@}*/
  149. /*! \name CAN Registers */
  150. /*@{*/
  151. #define CAN_TFI_OFF(x) (x * 16 + 0x00000020)
  152. /*@}*/
  153. /*! \name CAN Registers */
  154. /*@{*/
  155. #define CAN_TID_OFF(x) (x * 16 + 0x00000024)
  156. /*@}*/
  157. /*! \name CAN Registers */
  158. /*@{*/
  159. #define CAN_TDA_OFF(x) (x * 16 + 0x00000028)
  160. /*@}*/
  161. /*! \name CAN Registers */
  162. /*@{*/
  163. #define CAN_TDB_OFF(x) (x * 16 + 0x0000002C)
  164. /*@}*/
  165. /*! \name CAN1 Register Addresses */
  166. /*@{*/
  167. #ifdef LPC_CAN1_BASE
  168. #define CAN1_MOD (LPC_CAN1_BASE + CAN_MOD_OFF)
  169. #define CAN1_CMR (LPC_CAN1_BASE + CAN_CMR_OFF)
  170. #define CAN1_GSR (LPC_CAN1_BASE + CAN_GSR_OFF)
  171. #define CAN1_ICR (LPC_CAN1_BASE + CAN_ICR_OFF)
  172. #define CAN1_IER (LPC_CAN1_BASE + CAN_IER_OFF)
  173. #define CAN1_BTR (LPC_CAN1_BASE + CAN_BTR_OFF)
  174. #define CAN1_EWL (LPC_CAN1_BASE + CAN_EWL_OFF)
  175. #define CAN1_SR (LPC_CAN1_BASE + CAN_SR_OFF)
  176. #define CAN1_RFS (LPC_CAN1_BASE + CAN_RFS_OFF)
  177. #define CAN1_RID (LPC_CAN1_BASE + CAN_RID_OFF)
  178. #define CAN1_RDA (LPC_CAN1_BASE + CAN_RDA_OFF)
  179. #define CAN1_RDB (LPC_CAN1_BASE + CAN_RDB_OFF)
  180. #define CAN1_TFI(x) (LPC_CAN1_BASE + CAN_TFI_OFF(x))
  181. #define CAN1_TID(x) (LPC_CAN1_BASE + CAN_TID_OFF(x))
  182. #define CAN1_TDA(x) (LPC_CAN1_BASE + CAN_TDA_OFF(x))
  183. #define CAN1_TDB(x) (LPC_CAN1_BASE + CAN_TDB_OFF(x))
  184. #endif
  185. /*@}*/
  186. /*! \name CAN2 Register Addresses */
  187. /*@{*/
  188. #ifdef LPC_CAN2_BASE
  189. #define CAN2_MOD (LPC_CAN2_BASE + CAN_MOD_OFF)
  190. #define CAN2_CMR (LPC_CAN2_BASE + CAN_CMR_OFF)
  191. #define CAN2_GSR (LPC_CAN2_BASE + CAN_GSR_OFF)
  192. #define CAN2_ICR (LPC_CAN2_BASE + CAN_ICR_OFF)
  193. #define CAN2_IER (LPC_CAN2_BASE + CAN_IER_OFF)
  194. #define CAN2_BTR (LPC_CAN2_BASE + CAN_BTR_OFF)
  195. #define CAN2_EWL (LPC_CAN2_BASE + CAN_EWL_OFF)
  196. #define CAN2_SR (LPC_CAN2_BASE + CAN_SR_OFF)
  197. #define CAN2_RFS (LPC_CAN2_BASE + CAN_RFS_OFF)
  198. #define CAN2_RID (LPC_CAN2_BASE + CAN_RID_OFF)
  199. #define CAN2_RDA (LPC_CAN2_BASE + CAN_RDA_OFF)
  200. #define CAN2_RDB (LPC_CAN2_BASE + CAN_RDB_OFF)
  201. #define CAN2_TFI(x) (LPC_CAN2_BASE + CAN_TFI_OFF(x))
  202. #define CAN2_TID(x) (LPC_CAN2_BASE + CAN_TID_OFF(x))
  203. #define CAN2_TDA(x) (LPC_CAN2_BASE + CAN_TDA_OFF(x))
  204. #define CAN2_TDB(x) (LPC_CAN2_BASE + CAN_TDB_OFF(x))
  205. #endif
  206. /*@}*/
  207. /*@}*/
  208. #endif