F2837xD_device.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. //###########################################################################
  2. //
  3. // FILE: F2837xD_device.h
  4. //
  5. // TITLE: F2837xD Device Definitions.
  6. //
  7. //###########################################################################
  8. // $TI Release: F2837xD Support Library v3.05.00.00 $
  9. // $Release Date: Tue Jun 26 03:15:23 CDT 2018 $
  10. // $Copyright:
  11. // Copyright (C) 2013-2018 Texas Instruments Incorporated - http://www.ti.com/
  12. //
  13. // Redistribution and use in source and binary forms, with or without
  14. // modification, are permitted provided that the following conditions
  15. // are met:
  16. //
  17. // Redistributions of source code must retain the above copyright
  18. // notice, this list of conditions and the following disclaimer.
  19. //
  20. // Redistributions in binary form must reproduce the above copyright
  21. // notice, this list of conditions and the following disclaimer in the
  22. // documentation and/or other materials provided with the
  23. // distribution.
  24. //
  25. // Neither the name of Texas Instruments Incorporated nor the names of
  26. // its contributors may be used to endorse or promote products derived
  27. // from this software without specific prior written permission.
  28. //
  29. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  30. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  31. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  32. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  33. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  34. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  35. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  36. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  37. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  38. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  39. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. // $
  41. //###########################################################################
  42. #ifndef F2837xD_DEVICE_H
  43. #define F2837xD_DEVICE_H
  44. #if (!defined(CPU1) && !defined(CPU2))
  45. #error "You must define CPU1 or CPU2 in your project properties. Otherwise, the offsets in your header files will be inaccurate."
  46. #endif
  47. #if (defined(CPU1) && defined(CPU2))
  48. #error "You have defined both CPU1 and CPU2 in your project properties. Only a single CPU should be defined."
  49. #endif
  50. #ifdef __cplusplus
  51. extern "C" {
  52. #endif
  53. #define TARGET 1
  54. //
  55. // User To Select Target Device:
  56. //
  57. #define F28_2837xD TARGET
  58. //
  59. // Common CPU Definitions:
  60. //
  61. extern __cregister volatile unsigned int IFR;
  62. extern __cregister volatile unsigned int IER;
  63. #define EINT __asm(" clrc INTM")
  64. #define DINT __asm(" setc INTM")
  65. #define ERTM __asm(" clrc DBGM")
  66. #define DRTM __asm(" setc DBGM")
  67. #ifndef EALLOW
  68. #define EALLOW __asm(" EALLOW")
  69. #endif
  70. #ifndef EDIS
  71. #define EDIS __asm(" EDIS")
  72. #endif
  73. #define ESTOP0 __asm(" ESTOP0")
  74. #define M_INT1 0x0001
  75. #define M_INT2 0x0002
  76. #define M_INT3 0x0004
  77. #define M_INT4 0x0008
  78. #define M_INT5 0x0010
  79. #define M_INT6 0x0020
  80. #define M_INT7 0x0040
  81. #define M_INT8 0x0080
  82. #define M_INT9 0x0100
  83. #define M_INT10 0x0200
  84. #define M_INT11 0x0400
  85. #define M_INT12 0x0800
  86. #define M_INT13 0x1000
  87. #define M_INT14 0x2000
  88. #define M_DLOG 0x4000
  89. #define M_RTOS 0x8000
  90. #ifndef C28X_BIT0
  91. #define C28X_BIT0 0x00000001
  92. #endif
  93. #ifndef C28X_BIT1
  94. #define C28X_BIT1 0x00000002
  95. #endif
  96. #ifndef C28X_BIT2
  97. #define C28X_BIT2 0x00000004
  98. #endif
  99. #ifndef C28X_BIT3
  100. #define C28X_BIT3 0x00000008
  101. #endif
  102. #ifndef C28X_BIT4
  103. #define C28X_BIT4 0x00000010
  104. #endif
  105. #ifndef C28X_BIT5
  106. #define C28X_BIT5 0x00000020
  107. #endif
  108. #ifndef C28X_BIT6
  109. #define C28X_BIT6 0x00000040
  110. #endif
  111. #ifndef C28X_BIT7
  112. #define C28X_BIT7 0x00000080
  113. #endif
  114. #ifndef C28X_BIT8
  115. #define C28X_BIT8 0x00000100
  116. #endif
  117. #ifndef C28X_BIT9
  118. #define C28X_BIT9 0x00000200
  119. #endif
  120. #ifndef C28X_BIT10
  121. #define C28X_BIT10 0x00000400
  122. #endif
  123. #ifndef C28X_BIT11
  124. #define C28X_BIT11 0x00000800
  125. #endif
  126. #ifndef C28X_BIT12
  127. #define C28X_BIT12 0x00001000
  128. #endif
  129. #ifndef C28X_BIT13
  130. #define C28X_BIT13 0x00002000
  131. #endif
  132. #ifndef C28X_BIT14
  133. #define C28X_BIT14 0x00004000
  134. #endif
  135. #ifndef C28X_BIT15
  136. #define C28X_BIT15 0x00008000
  137. #endif
  138. #ifndef C28X_BIT16
  139. #define C28X_BIT16 0x00010000
  140. #endif
  141. #ifndef C28X_BIT17
  142. #define C28X_BIT17 0x00020000
  143. #endif
  144. #ifndef C28X_BIT18
  145. #define C28X_BIT18 0x00040000
  146. #endif
  147. #ifndef C28X_BIT19
  148. #define C28X_BIT19 0x00080000
  149. #endif
  150. #ifndef C28X_BIT20
  151. #define C28X_BIT20 0x00100000
  152. #endif
  153. #ifndef C28X_BIT21
  154. #define C28X_BIT21 0x00200000
  155. #endif
  156. #ifndef C28X_BIT22
  157. #define C28X_BIT22 0x00400000
  158. #endif
  159. #ifndef C28X_BIT23
  160. #define C28X_BIT23 0x00800000
  161. #endif
  162. #ifndef C28X_BIT24
  163. #define C28X_BIT24 0x01000000
  164. #endif
  165. #ifndef C28X_BIT25
  166. #define C28X_BIT25 0x02000000
  167. #endif
  168. #ifndef C28X_BIT26
  169. #define C28X_BIT26 0x04000000
  170. #endif
  171. #ifndef C28X_BIT27
  172. #define C28X_BIT27 0x08000000
  173. #endif
  174. #ifndef C28X_BIT28
  175. #define C28X_BIT28 0x10000000
  176. #endif
  177. #ifndef C28X_BIT29
  178. #define C28X_BIT29 0x20000000
  179. #endif
  180. #ifndef C28X_BIT30
  181. #define C28X_BIT30 0x40000000
  182. #endif
  183. #ifndef C28X_BIT31
  184. #define C28X_BIT31 0x80000000
  185. #endif
  186. //
  187. // For Portability, User Is Recommended To Use the C99 Standard integer types
  188. //
  189. #if !defined(__TMS320C28XX_CLA__)
  190. #include <assert.h>
  191. #include <stdarg.h>
  192. #endif //__TMS320C28XX_CLA__
  193. #include <stdbool.h>
  194. #include <stddef.h>
  195. #include <stdint.h>
  196. //
  197. // C++ Bool Compatibility
  198. //
  199. #if defined(__cplusplus)
  200. typedef bool _Bool;
  201. #endif
  202. //
  203. // C99 defines boolean type to be _Bool, but this doesn't match the format of
  204. // the other standard integer types. bool_t has been defined to fill this gap.
  205. //
  206. typedef _Bool bool_t;
  207. //
  208. //used for a bool function return status
  209. //
  210. typedef _Bool status_t;
  211. #ifndef SUCCESS
  212. #define SUCCESS true
  213. #endif
  214. #ifndef FAIL
  215. #define FAIL false
  216. #endif
  217. //
  218. // The following data types are included for compatibility with legacy code,
  219. // they are not recommended for use in new software. Please use the C99
  220. // types included above
  221. //
  222. #ifndef DSP28_DATA_TYPES
  223. #define DSP28_DATA_TYPES
  224. typedef int int16;
  225. typedef long int32;
  226. typedef long long int64;
  227. typedef unsigned int Uint16;
  228. typedef unsigned long Uint32;
  229. typedef unsigned long long Uint64;
  230. typedef float float32;
  231. typedef long double float64;
  232. #endif
  233. //
  234. // The following data types are for use with byte addressable peripherals.
  235. // See compiler documentation on the byte_peripheral type attribute.
  236. //
  237. #ifndef __TMS320C28XX_CLA__
  238. #if __TI_COMPILER_VERSION__ >= 16006000
  239. typedef unsigned int bp_16 __attribute__((byte_peripheral));
  240. typedef unsigned long bp_32 __attribute__((byte_peripheral));
  241. #endif
  242. #endif
  243. //
  244. // Include All Peripheral Header Files:
  245. //
  246. #include "F2837xD_adc.h"
  247. #include "F2837xD_analogsubsys.h"
  248. #include "F2837xD_cla.h"
  249. #include "F2837xD_cmpss.h"
  250. #include "F2837xD_cputimer.h"
  251. #include "F2837xD_dac.h"
  252. #include "F2837xD_dcsm.h"
  253. #include "F2837xD_dma.h"
  254. #include "F2837xD_ecap.h"
  255. #include "F2837xD_emif.h"
  256. #include "F2837xD_epwm.h" // Enhanced PWM
  257. #include "F2837xD_epwm_xbar.h"
  258. #include "F2837xD_eqep.h"
  259. #include "F2837xD_flash.h"
  260. #include "F2837xD_gpio.h" // General Purpose I/O Registers
  261. #include "F2837xD_i2c.h"
  262. #include "F2837xD_input_xbar.h"
  263. #include "F2837xD_ipc.h"
  264. #include "F2837xD_mcbsp.h"
  265. #include "F2837xD_memconfig.h"
  266. #include "F2837xD_nmiintrupt.h" // NMI Interrupt Registers
  267. #include "F2837xD_output_xbar.h"
  268. #include "F2837xD_piectrl.h" // PIE Control Registers
  269. #include "F2837xD_pievect.h"
  270. #include "F2837xD_sci.h"
  271. #include "F2837xD_sdfm.h"
  272. #include "F2837xD_spi.h"
  273. #include "F2837xD_sysctrl.h" // System Control/Power Modes
  274. #include "F2837xD_upp.h"
  275. #include "F2837xD_xbar.h"
  276. #include "F2837xD_xint.h" // External Interrupts
  277. //
  278. // byte_peripheral attribute is only supported on the C28
  279. //
  280. #ifndef __TMS320C28XX_CLA__
  281. #if __TI_COMPILER_VERSION__ >= 16006000
  282. #include "F2837xD_can.h"
  283. #endif
  284. #endif
  285. #ifdef __cplusplus
  286. }
  287. #endif // extern "C"
  288. #endif // end of F2837xD_DEVICE_H definition
  289. //
  290. // End of file.
  291. //