hw_cputimer.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. //###########################################################################
  2. //
  3. // FILE: hw_cputimer.h
  4. //
  5. // TITLE: Definitions for the C28x CPUTIMER registers.
  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 __HW_CPUTIMER_H__
  43. #define __HW_CPUTIMER_H__
  44. //*****************************************************************************
  45. //
  46. // The following are defines for the CPUTIMER register offsets
  47. //
  48. //*****************************************************************************
  49. #define CPUTIMER_O_TIM 0x0 // CPU-Timer, Counter Register
  50. #define CPUTIMER_O_TIMH 0x1 // CPU-Timer, Counter Register
  51. // High
  52. #define CPUTIMER_O_PRD 0x2 // CPU-Timer, Period Register
  53. #define CPUTIMER_O_PRDH 0x3 // CPU-Timer, Period Register High
  54. #define CPUTIMER_O_TCR 0x4 // CPU-Timer, Control Register
  55. #define CPUTIMER_O_TPR 0x6 // CPU-Timer, Prescale Register
  56. #define CPUTIMER_O_TPRH 0x7 // CPU-Timer, Prescale Register
  57. // High
  58. //*****************************************************************************
  59. //
  60. // The following are defines for the bit fields in the TIM register
  61. //
  62. //*****************************************************************************
  63. #define CPUTIMER_TIM_TIM_S 0
  64. #define CPUTIMER_TIM_TIM_M 0xFFFF // CPU-Timer Counter Registers
  65. //*****************************************************************************
  66. //
  67. // The following are defines for the bit fields in the TIMH register
  68. //
  69. //*****************************************************************************
  70. #define CPUTIMER_TIMH_TIMH_S 0
  71. #define CPUTIMER_TIMH_TIMH_M 0xFFFF // CPU-Timer Counter Registers
  72. // High
  73. //*****************************************************************************
  74. //
  75. // The following are defines for the bit fields in the PRD register
  76. //
  77. //*****************************************************************************
  78. #define CPUTIMER_PRD_PRD_S 0
  79. #define CPUTIMER_PRD_PRD_M 0xFFFF // CPU-Timer Period Registers
  80. //*****************************************************************************
  81. //
  82. // The following are defines for the bit fields in the PRDH register
  83. //
  84. //*****************************************************************************
  85. #define CPUTIMER_PRDH_PRDH_S 0
  86. #define CPUTIMER_PRDH_PRDH_M 0xFFFF // CPU-Timer Period Registers High
  87. //*****************************************************************************
  88. //
  89. // The following are defines for the bit fields in the TCR register
  90. //
  91. //*****************************************************************************
  92. #define CPUTIMER_TCR_TSS 0x10 // CPU-Timer stop status bit.
  93. #define CPUTIMER_TCR_TRB 0x20 // Timer reload
  94. #define CPUTIMER_TCR_FREE_SOFT_S 10
  95. #define CPUTIMER_TCR_FREE_SOFT_M 0xC00 // Emulation modes
  96. #define CPUTIMER_TCR_TIE 0x4000 // CPU-Timer Interrupt Enable.
  97. #define CPUTIMER_TCR_TIF 0x8000 // CPU-Timer Interrupt Flag.
  98. //*****************************************************************************
  99. //
  100. // The following are defines for the bit fields in the TPR register
  101. //
  102. //*****************************************************************************
  103. #define CPUTIMER_TPR_TDDR_S 0
  104. #define CPUTIMER_TPR_TDDR_M 0xFF // CPU-Timer Divide-Down.
  105. #define CPUTIMER_TPR_PSC_S 8
  106. #define CPUTIMER_TPR_PSC_M 0xFF00 // CPU-Timer Prescale Counter.
  107. //*****************************************************************************
  108. //
  109. // The following are defines for the bit fields in the TPRH register
  110. //
  111. //*****************************************************************************
  112. #define CPUTIMER_TPRH_TDDRH_S 0
  113. #define CPUTIMER_TPRH_TDDRH_M 0xFF // CPU-Timer Divide-Down.
  114. #define CPUTIMER_TPRH_PSCH_S 8
  115. #define CPUTIMER_TPRH_PSCH_M 0xFF00 // CPU-Timer Prescale Counter.
  116. #endif