PeripheralHeaderIncludes.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. //============================================================================
  2. //============================================================================
  3. //
  4. // FILE: PeripheralHeaderIncludes.h (2803x version)
  5. //
  6. // DESCRIPTION: Contains F2803x device specific definitions and includes
  7. //
  8. // VERSION: 04 Apr 2009 - (BRL)
  9. //============================================================================
  10. //============================================================================
  11. #ifndef DSP2803x_DEVICE_H
  12. #define DSP2803x_DEVICE_H 1
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. //---------------------------------------------------------------------------
  17. // CPU Timer Definitions:
  18. // Timer definitions based on 60MHz System Clock
  19. // if not using a 60MHz clock define a different set of constants elsewhere
  20. #define mSec0_5 30000 // 0.5 mS
  21. #define mSec1 60000 // 1.0 mS
  22. #define mSec2 120000 // 2.0 mS
  23. #define mSec5 300000 // 5.0 mS
  24. #define mSec7_5 450000 // 7.5 mS
  25. #define mSec10 600000 // 10 mS
  26. #define mSec20 1200000 // 20 mS
  27. #define mSec50 3000000 // 50 mS
  28. #define mSec100 6000000 // 100 mS
  29. #define mSec500 30000000 // 500 mS
  30. #define mSec1000 60000000 // 1000 mS
  31. #define mSec5000 300000000 // 5000 mS
  32. //---------------------------------------------------------------------------
  33. // Common CPU Definitions:
  34. //
  35. extern cregister volatile unsigned int IFR;
  36. extern cregister volatile unsigned int IER;
  37. #define EINT asm(" clrc INTM")
  38. #define DINT asm(" setc INTM")
  39. #define ERTM asm(" clrc DBGM")
  40. #define DRTM asm(" setc DBGM")
  41. #define EALLOW asm(" EALLOW")
  42. #define EDIS asm(" EDIS")
  43. #define ESTOP0 asm(" ESTOP0")
  44. #define M_INT1 0x0001
  45. #define M_INT2 0x0002
  46. #define M_INT3 0x0004
  47. #define M_INT4 0x0008
  48. #define M_INT5 0x0010
  49. #define M_INT6 0x0020
  50. #define M_INT7 0x0040
  51. #define M_INT8 0x0080
  52. #define M_INT9 0x0100
  53. #define M_INT10 0x0200
  54. #define M_INT11 0x0400
  55. #define M_INT12 0x0800
  56. #define M_INT13 0x1000
  57. #define M_INT14 0x2000
  58. #define M_DLOG 0x4000
  59. #define M_RTOS 0x8000
  60. #define BIT0 0x0001
  61. #define BIT1 0x0002
  62. #define BIT2 0x0004
  63. #define BIT3 0x0008
  64. #define BIT4 0x0010
  65. #define BIT5 0x0020
  66. #define BIT6 0x0040
  67. #define BIT7 0x0080
  68. #define BIT8 0x0100
  69. #define BIT9 0x0200
  70. #define BIT10 0x0400
  71. #define BIT11 0x0800
  72. #define BIT12 0x1000
  73. #define BIT13 0x2000
  74. #define BIT14 0x4000
  75. #define BIT15 0x8000
  76. //---------------------------------------------------------------------------
  77. // For Portability, User Is Recommended To Use Following Data Type Size
  78. // Definitions For 16-bit and 32-Bit Signed/Unsigned Integers:
  79. //
  80. #ifndef DSP28_DATA_TYPES
  81. #define DSP28_DATA_TYPES
  82. typedef int int16;
  83. typedef long int32;
  84. typedef unsigned int Uint16;
  85. typedef unsigned long Uint32;
  86. typedef float float32;
  87. typedef long double float64;
  88. #endif
  89. //---------------------------------------------------------------------------
  90. // Include All Peripheral Header Files:
  91. //
  92. #include "DSP2803x_Adc.h" // ADC Registers
  93. #include "DSP2803x_BootVars.h" // Boot ROM Variables
  94. #include "DSP2803x_DevEmu.h" // Device Emulation Registers
  95. #include "DSP2803x_Cla.h" // Control Law Accelerator Registers
  96. #include "DSP2803x_Comp.h" // Comparator Registers
  97. #include "DSP2803x_CpuTimers.h" // 32-bit CPU Timers
  98. #include "DSP2803x_ECan.h" // Enhanced eCAN Registers
  99. #include "DSP2803x_ECap.h" // Enhanced Capture
  100. #include "DSP2803x_EPwm.h" // Enhanced PWM
  101. #include "DSP2803x_EQep.h" // Enhanced QEP
  102. #include "DSP2803x_Gpio.h" // General Purpose I/O Registers
  103. #include "DSP2803x_I2c.h" // I2C Registers
  104. #include "DSP2803x_Lin.h" // LIN Registers
  105. #include "DSP2803x_NmiIntrupt.h" // NMI Interrupt Registers
  106. #include "DSP2803x_PieCtrl.h" // PIE Control Registers
  107. #include "DSP2803x_PieVect.h" // PIE Vector Table
  108. #include "DSP2803x_Spi.h" // SPI Registers
  109. #include "DSP2803x_Sci.h" // SCI Registers
  110. #include "DSP2803x_SysCtrl.h" // System Control/Power Modes
  111. #include "DSP2803x_XIntrupt.h" // External Interrupts
  112. #ifdef __cplusplus
  113. }
  114. #endif /* extern "C" */
  115. #endif // end of DSP2803x_DEVICE_H definition
  116. //===========================================================================
  117. // End of file.
  118. //===========================================================================