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