DSP2803x_Device.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. //###########################################################################
  2. //
  3. // FILE: DSP2803x_Device.h
  4. //
  5. // TITLE: DSP2803x Device Definitions.
  6. //
  7. //###########################################################################
  8. // $TI Release: F2803x C/C++ Header Files and Peripheral Examples V130 $
  9. // $Release Date: May 8, 2015 $
  10. // $Copyright: Copyright (C) 2009-2015 Texas Instruments Incorporated -
  11. // http://www.ti.com/ ALL RIGHTS RESERVED $
  12. //###########################################################################
  13. #ifndef DSP2803x_DEVICE_H
  14. #define DSP2803x_DEVICE_H
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #define TARGET 1
  19. //---------------------------------------------------------------------------
  20. // User To Select Target Device:
  21. #define DSP28_28030PAG 0
  22. #define DSP28_28030PN 0
  23. #define DSP28_28031PAG 0
  24. #define DSP28_28031PN 0
  25. #define DSP28_28032PAG 0
  26. #define DSP28_28032PN 0
  27. #define DSP28_28033PAG 0
  28. #define DSP28_28033PN 0
  29. #define DSP28_28034PAG 0
  30. #define DSP28_28034PN 0
  31. #define DSP28_28035PAG 0
  32. #define DSP28_28035PN TARGET
  33. //---------------------------------------------------------------------------
  34. // Common CPU Definitions:
  35. //
  36. extern __cregister volatile unsigned int IFR;
  37. extern __cregister volatile unsigned int IER;
  38. #define EINT __asm(" clrc INTM")
  39. #define DINT __asm(" setc INTM")
  40. #define ERTM __asm(" clrc DBGM")
  41. #define DRTM __asm(" setc DBGM")
  42. #define EALLOW __asm(" EALLOW")
  43. #define EDIS __asm(" EDIS")
  44. #define ESTOP0 __asm(" ESTOP0")
  45. #define M_INT1 0x0001
  46. #define M_INT2 0x0002
  47. #define M_INT3 0x0004
  48. #define M_INT4 0x0008
  49. #define M_INT5 0x0010
  50. #define M_INT6 0x0020
  51. #define M_INT7 0x0040
  52. #define M_INT8 0x0080
  53. #define M_INT9 0x0100
  54. #define M_INT10 0x0200
  55. #define M_INT11 0x0400
  56. #define M_INT12 0x0800
  57. #define M_INT13 0x1000
  58. #define M_INT14 0x2000
  59. #define M_DLOG 0x4000
  60. #define M_RTOS 0x8000
  61. #define BIT0 0x0001
  62. #define BIT1 0x0002
  63. #define BIT2 0x0004
  64. #define BIT3 0x0008
  65. #define BIT4 0x0010
  66. #define BIT5 0x0020
  67. #define BIT6 0x0040
  68. #define BIT7 0x0080
  69. #define BIT8 0x0100
  70. #define BIT9 0x0200
  71. #define BIT10 0x0400
  72. #define BIT11 0x0800
  73. #define BIT12 0x1000
  74. #define BIT13 0x2000
  75. #define BIT14 0x4000
  76. #define BIT15 0x8000
  77. //---------------------------------------------------------------------------
  78. // For Portability, User Is Recommended To Use Following Data Type Size
  79. // Definitions For 16-bit and 32-Bit Signed/Unsigned Integers:
  80. //
  81. #ifndef DSP28_DATA_TYPES
  82. #define DSP28_DATA_TYPES
  83. typedef int int16;
  84. typedef long int32;
  85. typedef unsigned int Uint16;
  86. typedef unsigned long Uint32;
  87. typedef float float32;
  88. typedef long double float64;
  89. #endif
  90. //---------------------------------------------------------------------------
  91. // Include All Peripheral Header Files:
  92. //
  93. #include "DSP2803x_ECan.h" // Enhanced eCAN Registers
  94. #include "DSP2803x_Gpio.h" // General Purpose I/O Registers
  95. #include "DSP2803x_SysCtrl.h" // System Control/Power Modes
  96. #include "Flash2803x_API_Config.h"
  97. /*
  98. #include "DSP2803x_Adc.h" // ADC Registers
  99. #include "DSP2803x_BootVars.h" // Boot ROM Variables
  100. #include "DSP2803x_DevEmu.h" // Device Emulation Registers
  101. #include "DSP2803x_Cla.h" // Control Law Accelerator Registers
  102. #include "DSP2803x_Comp.h" // Comparator Registers
  103. #include "DSP2803x_CpuTimers.h" // 32-bit CPU Timers
  104. #include "DSP2803x_ECan.h" // Enhanced eCAN Registers
  105. #include "DSP2803x_ECap.h" // Enhanced Capture
  106. #include "DSP2803x_EPwm.h" // Enhanced PWM
  107. #include "DSP2803x_EQep.h" // Enhanced QEP
  108. #include "DSP2803x_Gpio.h" // General Purpose I/O Registers
  109. #include "DSP2803x_HRCap.h" // High Resolution Capture
  110. #include "DSP2803x_I2c.h" // I2C Registers
  111. #include "DSP2803x_Lin.h" // LIN Registers
  112. #include "DSP2803x_NmiIntrupt.h" // NMI Interrupt Registers
  113. #include "DSP2803x_PieCtrl.h" // PIE Control Registers
  114. #include "DSP2803x_PieVect.h" // PIE Vector Table
  115. #include "DSP2803x_Spi.h" // SPI Registers
  116. #include "DSP2803x_Sci.h" // SCI Registers
  117. #include "DSP2803x_SysCtrl.h" // System Control/Power Modes
  118. #include "DSP2803x_XIntrupt.h" // External Interrupts
  119. */
  120. #if (DSP28_28035PN||DSP28_28034PN||DSP28_28033PN||DSP28_28032PN||DSP28_28031PN||DSP28_28030PN)
  121. #define DSP28_COMP1 1
  122. #define DSP28_COMP2 1
  123. #define DSP28_COMP3 1
  124. #define DSP28_EPWM1 1
  125. #define DSP28_EPWM2 1
  126. #define DSP28_EPWM3 1
  127. #define DSP28_EPWM4 1
  128. #define DSP28_EPWM5 1
  129. #define DSP28_EPWM6 1
  130. #define DSP28_EPWM7 1
  131. #define DSP28_ECAP1 1
  132. #define DSP28_EQEP1 1
  133. #define DSP28_ECANA 1
  134. #define DSP28_HRCAP1 1
  135. #define DSP28_HRCAP2 1
  136. #define DSP28_SPIA 1
  137. #define DSP28_SPIB 1
  138. #define DSP28_SCIA 1
  139. #define DSP28_I2CA 1
  140. #define DSP28_LINA 1
  141. #endif
  142. #if (DSP28_28035PAG||DSP28_28034PAG||DSP28_28033PAG||DSP28_28032PAG||DSP28_28031PAG||DSP28_28030PAG)
  143. #define DSP28_COMP1 1
  144. #define DSP28_COMP2 1
  145. #define DSP28_COMP3 1
  146. #define DSP28_EPWM1 1
  147. #define DSP28_EPWM2 1
  148. #define DSP28_EPWM3 1
  149. #define DSP28_EPWM4 1
  150. #define DSP28_EPWM5 1
  151. #define DSP28_EPWM6 1
  152. #define DSP28_EPWM7 0
  153. #define DSP28_ECAP1 1
  154. #define DSP28_EQEP1 1
  155. #define DSP28_ECANA 1
  156. #define DSP28_HRCAP1 1
  157. #define DSP28_HRCAP2 1
  158. #define DSP28_SPIA 1
  159. #define DSP28_SPIB 0
  160. #define DSP28_SCIA 1
  161. #define DSP28_I2CA 1
  162. #define DSP28_LINA 1
  163. #endif
  164. // Timer definitions based on System Clock
  165. // 60 MHz devices
  166. #define mSec0_5 30000 // 0.5 mS
  167. #define mSec0_75 45000 // 0.75 mS
  168. #define mSec1 60000 // 1.0 mS
  169. #define mSec2 120000 // 2.0 mS
  170. #define mSec5 300000 // 5.0 mS
  171. #define mSec7_5 450000 // 7.5 mS
  172. #define mSec10 600000 // 10 mS
  173. #define mSec20 1200000 // 20 mS
  174. #define mSec50 3000000 // 50 mS
  175. #define mSec75 4500000 // 75 mS
  176. #define mSec100 6000000 // 100 mS
  177. #define mSec200 12000000 // 200 mS
  178. #define mSec500 30000000 // 500 mS
  179. #define mSec750 45000000 // 750 mS
  180. #define mSec1000 60000000 // 1000 mS
  181. #define mSec2000 120000000 // 2000 mS
  182. #define mSec5000 300000000 // 5000 mS
  183. #ifdef __cplusplus
  184. }
  185. #endif /* extern "C" */
  186. #endif // end of DSP2803x_DEVICE_H definition
  187. //===========================================================================
  188. // End of file.
  189. //===========================================================================