F2837xD_cputimer.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. //###########################################################################
  2. //
  3. // FILE: F2837xD_cputimer.h
  4. //
  5. // TITLE: CPUTIMER Register 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_CPUTIMER_H__
  43. #define __F2837xD_CPUTIMER_H__
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. //---------------------------------------------------------------------------
  48. // CPUTIMER Individual Register Bit Definitions:
  49. struct TIM_BITS { // bits description
  50. Uint16 LSW:16; // 15:0 CPU-Timer Counter Registers
  51. Uint16 MSW:16; // 31:16 CPU-Timer Counter Registers High
  52. };
  53. union TIM_REG {
  54. Uint32 all;
  55. struct TIM_BITS bit;
  56. };
  57. struct PRD_BITS { // bits description
  58. Uint16 LSW:16; // 15:0 CPU-Timer Period Registers
  59. Uint16 MSW:16; // 31:16 CPU-Timer Period Registers High
  60. };
  61. union PRD_REG {
  62. Uint32 all;
  63. struct PRD_BITS bit;
  64. };
  65. struct TCR_BITS { // bits description
  66. Uint16 rsvd1:4; // 3:0 Reserved
  67. Uint16 TSS:1; // 4 CPU-Timer stop status bit.
  68. Uint16 TRB:1; // 5 Timer reload
  69. Uint16 rsvd2:4; // 9:6 Reserved
  70. Uint16 SOFT:1; // 10 Emulation modes
  71. Uint16 FREE:1; // 11 Emulation modes
  72. Uint16 rsvd3:2; // 13:12 Reserved
  73. Uint16 TIE:1; // 14 CPU-Timer Interrupt Enable.
  74. Uint16 TIF:1; // 15 CPU-Timer Interrupt Flag.
  75. };
  76. union TCR_REG {
  77. Uint16 all;
  78. struct TCR_BITS bit;
  79. };
  80. struct TPR_BITS { // bits description
  81. Uint16 TDDR:8; // 7:0 CPU-Timer Divide-Down.
  82. Uint16 PSC:8; // 15:8 CPU-Timer Prescale Counter.
  83. };
  84. union TPR_REG {
  85. Uint16 all;
  86. struct TPR_BITS bit;
  87. };
  88. struct TPRH_BITS { // bits description
  89. Uint16 TDDRH:8; // 7:0 CPU-Timer Divide-Down.
  90. Uint16 PSCH:8; // 15:8 CPU-Timer Prescale Counter.
  91. };
  92. union TPRH_REG {
  93. Uint16 all;
  94. struct TPRH_BITS bit;
  95. };
  96. struct CPUTIMER_REGS {
  97. union TIM_REG TIM; // CPU-Timer, Counter Register
  98. union PRD_REG PRD; // CPU-Timer, Period Register
  99. union TCR_REG TCR; // CPU-Timer, Control Register
  100. Uint16 rsvd1; // Reserved
  101. union TPR_REG TPR; // CPU-Timer, Prescale Register
  102. union TPRH_REG TPRH; // CPU-Timer, Prescale Register High
  103. };
  104. //---------------------------------------------------------------------------
  105. // CPUTIMER External References & Function Declarations:
  106. //
  107. #ifdef CPU1
  108. extern volatile struct CPUTIMER_REGS CpuTimer0Regs;
  109. extern volatile struct CPUTIMER_REGS CpuTimer1Regs;
  110. extern volatile struct CPUTIMER_REGS CpuTimer2Regs;
  111. #endif
  112. #ifdef CPU2
  113. extern volatile struct CPUTIMER_REGS CpuTimer0Regs;
  114. extern volatile struct CPUTIMER_REGS CpuTimer1Regs;
  115. extern volatile struct CPUTIMER_REGS CpuTimer2Regs;
  116. #endif
  117. #ifdef __cplusplus
  118. }
  119. #endif /* extern "C" */
  120. #endif
  121. //===========================================================================
  122. // End of file.
  123. //===========================================================================