F2837xD_dac.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. //###########################################################################
  2. //
  3. // FILE: F2837xD_dac.h
  4. //
  5. // TITLE: DAC 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_DAC_H__
  43. #define __F2837xD_DAC_H__
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. //---------------------------------------------------------------------------
  48. // DAC Individual Register Bit Definitions:
  49. struct DACREV_BITS { // bits description
  50. Uint16 REV:8; // 7:0 DAC Revision Register
  51. Uint16 rsvd1:8; // 15:8 Reserved
  52. };
  53. union DACREV_REG {
  54. Uint16 all;
  55. struct DACREV_BITS bit;
  56. };
  57. struct DACCTL_BITS { // bits description
  58. Uint16 DACREFSEL:1; // 0 DAC Reference Select
  59. Uint16 rsvd1:1; // 1 Reserved
  60. Uint16 LOADMODE:1; // 2 DACVALA Load Mode
  61. Uint16 rsvd2:1; // 3 Reserved
  62. Uint16 SYNCSEL:4; // 7:4 DAC PWMSYNC Select
  63. Uint16 rsvd3:8; // 15:8 Reserved
  64. };
  65. union DACCTL_REG {
  66. Uint16 all;
  67. struct DACCTL_BITS bit;
  68. };
  69. struct DACVALA_BITS { // bits description
  70. Uint16 DACVALA:12; // 11:0 DAC Active Output Code
  71. Uint16 rsvd1:4; // 15:12 Reserved
  72. };
  73. union DACVALA_REG {
  74. Uint16 all;
  75. struct DACVALA_BITS bit;
  76. };
  77. struct DACVALS_BITS { // bits description
  78. Uint16 DACVALS:12; // 11:0 DAC Shadow Output Code
  79. Uint16 rsvd1:4; // 15:12 Reserved
  80. };
  81. union DACVALS_REG {
  82. Uint16 all;
  83. struct DACVALS_BITS bit;
  84. };
  85. struct DACOUTEN_BITS { // bits description
  86. Uint16 DACOUTEN:1; // 0 DAC Output Code
  87. Uint16 rsvd1:15; // 15:1 Reserved
  88. };
  89. union DACOUTEN_REG {
  90. Uint16 all;
  91. struct DACOUTEN_BITS bit;
  92. };
  93. struct DACLOCK_BITS { // bits description
  94. Uint16 DACCTL:1; // 0 DAC Control Register Lock
  95. Uint16 DACVAL:1; // 1 DAC Value Register Lock
  96. Uint16 DACOUTEN:1; // 2 DAC Output Enable Register Lock
  97. Uint16 rsvd1:13; // 15:3 Reserved
  98. };
  99. union DACLOCK_REG {
  100. Uint16 all;
  101. struct DACLOCK_BITS bit;
  102. };
  103. struct DACTRIM_BITS { // bits description
  104. Uint16 OFFSET_TRIM:8; // 7:0 DAC Offset Trim
  105. Uint16 rsvd1:4; // 11:8 Reserved
  106. Uint16 rsvd2:4; // 15:12 Reserved
  107. };
  108. union DACTRIM_REG {
  109. Uint16 all;
  110. struct DACTRIM_BITS bit;
  111. };
  112. struct DAC_REGS {
  113. union DACREV_REG DACREV; // DAC Revision Register
  114. union DACCTL_REG DACCTL; // DAC Control Register
  115. union DACVALA_REG DACVALA; // DAC Value Register - Active
  116. union DACVALS_REG DACVALS; // DAC Value Register - Shadow
  117. union DACOUTEN_REG DACOUTEN; // DAC Output Enable Register
  118. union DACLOCK_REG DACLOCK; // DAC Lock Register
  119. union DACTRIM_REG DACTRIM; // DAC Trim Register
  120. Uint16 rsvd1; // Reserved
  121. };
  122. //---------------------------------------------------------------------------
  123. // DAC External References & Function Declarations:
  124. //
  125. #ifdef CPU1
  126. extern volatile struct DAC_REGS DacaRegs;
  127. extern volatile struct DAC_REGS DacbRegs;
  128. extern volatile struct DAC_REGS DaccRegs;
  129. #endif
  130. #ifdef CPU2
  131. extern volatile struct DAC_REGS DacaRegs;
  132. extern volatile struct DAC_REGS DacbRegs;
  133. extern volatile struct DAC_REGS DaccRegs;
  134. #endif
  135. #ifdef __cplusplus
  136. }
  137. #endif /* extern "C" */
  138. #endif
  139. //===========================================================================
  140. // End of file.
  141. //===========================================================================