2 * @brief DCC Driver Definition File
8 /* (c) Texas Instruments 2009-2012, All rights reserved. */
16 /* DCC General Definitions */
18 /** @def dcc1CNT0_CLKSRC_HFLPO
19 * @brief Alias name for DCC1 Counter 0 Clock Source HFLPO
21 * This is an alias name for the Clock Source HFLPO for DCC1 Counter 0.
23 * @note This value should be used for API argument @a cnt0_Clock_Source
25 #define dcc1CNT0_CLKSRC_HFLPO 0x00000005U
27 /** @def dcc1CNT0_CLKSRC_TCK
28 * @brief Alias name for DCC1 Counter 0 Clock Source TCK
30 * This is an alias name for the Clock Source TCK for DCC1 Counter 0.
32 * @note This value should be used for API argument @a cnt0_Clock_Source
34 #define dcc1CNT0_CLKSRC_TCK 0x0000000AU
36 /** @def dcc1CNT0_CLKSRC_OSCIN
37 * @brief Alias name for DCC1 Counter 0 Clock Source OSCIN
39 * This is an alias name for the Clock Source OSCIN for DCC1 Counter 0.
41 * @note This value should be used for API argument @a cnt0_Clock_Source
43 #define dcc1CNT0_CLKSRC_OSCIN 0x0000000FU
45 /** @def dcc1CNT1_CLKSRC_PLL1
46 * @brief Alias name for DCC1 Counter 1 Clock Source PLL1
48 * This is an alias name for the Clock Source PLL for DCC1 Counter 1.
50 * @note This value should be used for API argument @a cnt1_Clock_Source
52 #define dcc1CNT1_CLKSRC_PLL1 0x0000A0000U
54 /** @def dcc1CNT1_CLKSRC_PLL2
55 * @brief Alias name for DCC1 Counter 1 Clock Source PLL2
57 * This is an alias name for the Clock Source OSCIN for DCC1 Counter 1.
59 * @note This value should be used for API argument @a cnt1_Clock_Source
61 #define dcc1CNT1_CLKSRC_PLL2 0x0000A0001U
63 /** @def dcc1CNT1_CLKSRC_LFLPO
64 * @brief Alias name for DCC1 Counter 1 Clock Source LFLPO
66 * This is an alias name for the Clock Source LFLPO for DCC1 Counter 1.
68 * @note This value should be used for API argument @a cnt1_Clock_Source
70 #define dcc1CNT1_CLKSRC_LFLPO 0x0000A0002U
72 /** @def dcc1CNT1_CLKSRC_HFLPO
73 * @brief Alias name for DCC1 Counter 1 Clock Source HFLPO
75 * This is an alias name for the Clock Source HFLPO for DCC1 Counter 1.
77 * @note This value should be used for API argument @a cnt1_Clock_Source
79 #define dcc1CNT1_CLKSRC_HFLPO 0x0000A0003U
81 /** @def dcc1CNT1_CLKSRC_EXTCLKIN1
82 * @brief Alias name for DCC1 Counter 1 Clock Source EXTCLKIN1
84 * This is an alias name for the Clock Source EXTCLKIN1 for DCC1 Counter 1.
86 * @note This value should be used for API argument @a cnt1_Clock_Source
88 #define dcc1CNT1_CLKSRC_EXTCLKIN1 0x0000A0005U
90 /** @def dcc1CNT1_CLKSRC_EXTCLKIN2
91 * @brief Alias name for DCC1 Counter 1 Clock Source EXTCLKIN2
93 * This is an alias name for the Clock Source EXTCLKIN2 for DCC1 Counter 1.
95 * @note This value should be used for API argument @a cnt1_Clock_Source
97 #define dcc1CNT1_CLKSRC_EXTCLKIN2 0x0000A0006U
99 /** @def dcc1CNT1_CLKSRC_VCLK
100 * @brief Alias name for DCC1 Counter 1 Clock Source VCLK
102 * This is an alias name for the Clock Source VCLK for DCC1 Counter 1.
104 * @note This value should be used for API argument @a cnt1_Clock_Source
106 #define dcc1CNT1_CLKSRC_VCLK 0x0000A0008U
108 /** @def dcc1CNT1_CLKSRC_N2HET1_31
109 * @brief Alias name for DCC1 Counter 1 Clock Source N2HET1_31
111 * This is an alias name for the Clock Source N2HET1_31 for DCC1 Counter 1.
113 * @note This value should be used for API argument @a cnt1_Clock_Source
115 #define dcc1CNT1_CLKSRC_N2HET1_31 0x00005000FU
117 /** @def dcc2CNT0_CLKSRC_TCK
118 * @brief Alias name for DCC2 Counter 0 Clock Source TCK
120 * This is an alias name for the Clock Source TCK for DCC2 Counter 0.
122 * @note This value should be used for API argument @a cnt0_Clock_Source
124 #define dcc2CNT0_CLKSRC_TCK 0x0000000AU
126 /** @def dcc1CNT0_CLKSRC_OSCIN
127 * @brief Alias name for DCC1 Counter 0 Clock Source OSCIN
129 * This is an alias name for the Clock Source OSCIN for DCC2 Counter 0.
131 * @note This value should be used for API argument @a cnt0_Clock_Source
133 #define dcc2CNT0_CLKSRC_OSCIN 0x0000000FU
135 /** @def dcc2CNT1_CLKSRC_VCLK
136 * @brief Alias name for DCC2 Counter 1 Clock Source VCLK
138 * This is an alias name for the Clock Source VCLK for DCC2 Counter 1.
140 * @note This value should be used for API argument @a cnt1_Clock_Source
142 #define dcc2CNT1_CLKSRC_VCLK 0x0000A0008U
144 /** @def dcc2CNT1_CLKSRC_N2HET1_0
145 * @brief Alias name for DCC2 Counter 1 Clock Source N2HET2_0
147 * This is an alias name for the Clock Source N2HET2_0 for DCC2 Counter 1.
149 * @note This value should be used for API argument @a cnt1_Clock_Source
151 #define dcc2CNT1_CLKSRC_N2HET1_0 0x00005000FU
153 /** @def dccNOTIFICATION_DONE
154 * @brief Alias name for DCC Done notification
156 * This is an alias name for the DCC Done notification.
158 * @note This value should be used for API argument @a notification
160 #define dccNOTIFICATION_DONE 0x0000A000U
162 /** @def dccNOTIFICATION_ERROR
163 * @brief Alias name for DCC Error notification
165 * This is an alias name for the DCC Error notification.
167 * @note This value should be used for API argument @a notification
169 #define dccNOTIFICATION_ERROR 0x000000A0U
172 /** @enum dcc1clocksource
173 * @brief Alias names for dcc clock sources
175 * This enumeration is used to provide alias names for the clock sources:
179 DCC1_CNT0_HF_LPO = 0x5, /**< Alias for DCC1 CNT 0 CLOCK SOURCE 0*/
180 DCC1_CNT0_TCK = 0xA, /**< Alias for DCC1 CNT 0 CLOCK SOURCE 1*/
181 DCC1_CNT0_OSCIN = 0xF, /**< Alias for DCC1 CNT 0 CLOCK SOURCE 2*/
183 DCC1_CNT1_PLL1 = 0x0, /**< Alias for DCC1 CNT 1 CLOCK SOURCE 0*/
184 DCC1_CNT1_PLL2 = 0x1, /**< Alias for DCC1 CNT 1 CLOCK SOURCE 1*/
185 DCC1_CNT1_LF_LPO = 0x2, /**< Alias for DCC1 CNT 1 CLOCK SOURCE 2*/
186 DCC1_CNT1_HF_LPO = 0x3, /**< Alias for DCC1 CNT 1 CLOCK SOURCE 3*/
187 DCC1_CNT1_EXTCLKIN1 = 0x5, /**< Alias for DCC1 CNT 1 CLOCK SOURCE 4*/
188 DCC1_CNT1_EXTCLKIN2 = 0x6, /**< Alias for DCC1 CNT 1 CLOCK SOURCE 6*/
189 DCC1_CNT1_VCLK = 0x8, /**< Alias for DCC1 CNT 1 CLOCK SOURCE 8*/
190 DCC1_CNT1_N2HET1_31 = 0xA /**< Alias for DCC1 CNT 1 CLOCK SOURCE 9*/
193 /** @enum dcc2clocksource
194 * @brief Alias names for dcc clock sources
196 * This enumeration is used to provide alias names for the clock sources:
200 DCC2_CNT0_OSCIN = 0xF, /**< Alias for DCC1 CNT 0 CLOCK SOURCE 0*/
201 DCC2_CNT0_TCK = 0xA, /**< Alias for DCC1 CNT 0 CLOCK SOURCE 2*/
203 DCC2_CNT1_VCLK = 0x8, /**< Alias for DCC1 CNT 1 CLOCK SOURCE 8*/
204 DCC2_CNT1_N2HET2_0 = 0xA /**< Alias for DCC1 CNT 1 CLOCK SOURCE 9*/
208 * @brief DCC Base Register Definition
210 * This structure is used to access the DCC module egisters.
212 /** @typedef dccBASE_t
213 * @brief DCC Register Frame Type Definition
215 * This type is used to access the DCC Registers.
217 typedef volatile struct dccBase
219 uint32_t GCTRL; /**< 0x0000: DCC Control Register */
220 uint32_t REV; /**< 0x0004: DCC Revision Id Register */
221 uint32_t CNT0SEED; /**< 0x0008: DCC Counter0 Seed Register */
222 uint32_t VALID0SEED; /**< 0x000C: DCC Valid0 Seed Register */
223 uint32_t CNT1SEED; /**< 0x0010: DCC Counter1 Seed Register */
224 uint32_t STAT; /**< 0x0014: DCC Status Register */
225 uint32_t CNT0; /**< 0x0018: DCC Counter0 Value Register */
226 uint32_t VALID0; /**< 0x001C: DCC Valid0 Value Register */
227 uint32_t CNT1; /**< 0x0020: DCC Counter1 Value Register */
228 uint32_t CLKSRC1; /**< 0x0024: DCC Counter1 Clock Source Selection Register */
229 uint32_t CLKSRC0; /**< 0x0028: DCC Counter0 Clock Source Selection Register */
234 * @brief DCC1 Register Frame Pointer
236 * This pointer is used by the DCC driver to access the dcc2 module registers.
238 #define dccREG1 ((dccBASE_t *)0xFFFFEC00U)
242 * @brief DCC2 Register Frame Pointer
244 * This pointer is used by the DCC driver to access the dcc2 module registers.
246 #define dccREG2 ((dccBASE_t *)0xFFFFF400U)
249 /* DCC Interface Functions */
251 void dccSetCounter0Seed(dccBASE_t *dcc, uint32_t cnt0seed);
252 void dccSetTolerance(dccBASE_t *dcc, uint32_t valid0seed);
253 void dccSetCounter1Seed(dccBASE_t *dcc, uint32_t cnt1seed);
254 void dccSetSeed(dccBASE_t *dcc, uint32_t cnt0seed, uint32_t valid0seed, uint32_t cn1seed);
255 void dccSelectClockSource(dccBASE_t *dcc, uint32_t cnt0_Clock_Source, uint32_t cnt1_Clock_Source);
256 void dccEnable(dccBASE_t *dcc);
257 void dccDisable(dccBASE_t *dcc);
258 uint32_t dccGetErrStatus(dccBASE_t *dcc);
260 void dccEnableNotification(dccBASE_t *dcc, uint32_t notification);
261 void dccDisableNotification(dccBASE_t *dcc, uint32_t notification);
263 /** @fn void dccNotification(dccBASE_t *dcc,uint32_t flags)
264 * @brief Interrupt callback
265 * @param[in] dcc - dcc module base address
266 * @param[in] flags - status flags
268 * This is a callback function provided by the application. It is call when
269 * a dcc is complete or detected error.
271 void dccNotification(dccBASE_t *dcc,uint32_t flags);