DSP2803x_ECap.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. //###########################################################################
  2. //
  3. // FILE: DSP2803x_ECap.h
  4. //
  5. // TITLE: DSP2803x Enhanced Capture Module Register Bit 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_ECAP_H
  14. #define DSP2803x_ECAP_H
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. //----------------------------------------------------
  19. // Capture control register 1 bit definitions */
  20. struct ECCTL1_BITS { // bits description
  21. Uint16 CAP1POL:1; // 0 Capture Event 1 Polarity select
  22. Uint16 CTRRST1:1; // 1 Counter Reset on Capture Event 1
  23. Uint16 CAP2POL:1; // 2 Capture Event 2 Polarity select
  24. Uint16 CTRRST2:1; // 3 Counter Reset on Capture Event 2
  25. Uint16 CAP3POL:1; // 4 Capture Event 3 Polarity select
  26. Uint16 CTRRST3:1; // 5 Counter Reset on Capture Event 3
  27. Uint16 CAP4POL:1; // 6 Capture Event 4 Polarity select
  28. Uint16 CTRRST4:1; // 7 Counter Reset on Capture Event 4
  29. Uint16 CAPLDEN:1; // 8 Enable Loading CAP1-4 regs on a Cap Event
  30. Uint16 PRESCALE:5; // 13:9 Event Filter prescale select
  31. Uint16 FREE_SOFT:2; // 15:14 Emulation mode
  32. };
  33. union ECCTL1_REG {
  34. Uint16 all;
  35. struct ECCTL1_BITS bit;
  36. };
  37. // In V1.1 the STOPVALUE bit field was changed to
  38. // STOP_WRAP. This correlated to a silicon change from
  39. // F2803x Rev 0 to Rev A.
  40. //----------------------------------------------------
  41. // Capture control register 2 bit definitions */
  42. struct ECCTL2_BITS { // bits description
  43. Uint16 CONT_ONESHT:1; // 0 Continuous or one-shot
  44. Uint16 STOP_WRAP:2; // 2:1 Stop value for one-shot, Wrap for continuous
  45. Uint16 REARM:1; // 3 One-shot re-arm
  46. Uint16 TSCTRSTOP:1; // 4 TSCNT counter stop
  47. Uint16 SYNCI_EN:1; // 5 Counter sync-in select
  48. Uint16 SYNCO_SEL:2; // 7:6 Sync-out mode
  49. Uint16 SWSYNC:1; // 8 SW forced counter sync
  50. Uint16 CAP_APWM:1; // 9 CAP/APWM operating mode select
  51. Uint16 APWMPOL:1; // 10 APWM output polarity select
  52. Uint16 rsvd1:5; // 15:11
  53. };
  54. union ECCTL2_REG {
  55. Uint16 all;
  56. struct ECCTL2_BITS bit;
  57. };
  58. //----------------------------------------------------
  59. // ECAP interrupt enable register bit definitions */
  60. struct ECEINT_BITS { // bits description
  61. Uint16 rsvd1:1; // 0 reserved
  62. Uint16 CEVT1:1; // 1 Capture Event 1 Interrupt Enable
  63. Uint16 CEVT2:1; // 2 Capture Event 2 Interrupt Enable
  64. Uint16 CEVT3:1; // 3 Capture Event 3 Interrupt Enable
  65. Uint16 CEVT4:1; // 4 Capture Event 4 Interrupt Enable
  66. Uint16 CTROVF:1; // 5 Counter Overflow Interrupt Enable
  67. Uint16 CTR_EQ_PRD:1; // 6 Period Equal Interrupt Enable
  68. Uint16 CTR_EQ_CMP:1; // 7 Compare Equal Interrupt Enable
  69. Uint16 rsvd2:8; // 15:8 reserved
  70. };
  71. union ECEINT_REG {
  72. Uint16 all;
  73. struct ECEINT_BITS bit;
  74. };
  75. //----------------------------------------------------
  76. // ECAP interrupt flag register bit definitions */
  77. struct ECFLG_BITS { // bits description
  78. Uint16 INT:1; // 0 Global Flag
  79. Uint16 CEVT1:1; // 1 Capture Event 1 Interrupt Flag
  80. Uint16 CEVT2:1; // 2 Capture Event 2 Interrupt Flag
  81. Uint16 CEVT3:1; // 3 Capture Event 3 Interrupt Flag
  82. Uint16 CEVT4:1; // 4 Capture Event 4 Interrupt Flag
  83. Uint16 CTROVF:1; // 5 Counter Overflow Interrupt Flag
  84. Uint16 CTR_EQ_PRD:1; // 6 Period Equal Interrupt Flag
  85. Uint16 CTR_EQ_CMP:1; // 7 Compare Equal Interrupt Flag
  86. Uint16 rsvd2:8; // 15:8 reserved
  87. };
  88. union ECFLG_REG {
  89. Uint16 all;
  90. struct ECFLG_BITS bit;
  91. };
  92. //----------------------------------------------------
  93. struct ECAP_REGS {
  94. Uint32 TSCTR; // Time stamp counter
  95. Uint32 CTRPHS; // Counter phase
  96. Uint32 CAP1; // Capture 1
  97. Uint32 CAP2; // Capture 2
  98. Uint32 CAP3; // Capture 3
  99. Uint32 CAP4; // Capture 4
  100. Uint16 rsvd1[8]; // reserved
  101. union ECCTL1_REG ECCTL1; // Capture Control Reg 1
  102. union ECCTL2_REG ECCTL2; // Capture Control Reg 2
  103. union ECEINT_REG ECEINT; // ECAP interrupt enable
  104. union ECFLG_REG ECFLG; // ECAP interrupt flags
  105. union ECFLG_REG ECCLR; // ECAP interrupt clear
  106. union ECEINT_REG ECFRC; // ECAP interrupt force
  107. Uint16 rsvd2[6]; // reserved
  108. };
  109. //---------------------------------------------------------------------------
  110. // GPI/O External References & Function Declarations:
  111. //
  112. extern volatile struct ECAP_REGS ECap1Regs;
  113. #ifdef __cplusplus
  114. }
  115. #endif /* extern "C" */
  116. #endif // end of DSP2803x_ECAP_H definition
  117. //===========================================================================
  118. // End of file.
  119. //===========================================================================