2 ** ###################################################################
3 ** Compilers: Keil ARM C/C++ Compiler
4 ** Freescale C/C++ for Embedded ARM
6 ** IAR ANSI C/C++ Compiler for ARM
8 ** Reference manual: K64P144M120SF5RM, Rev.2, January 2014
9 ** Version: rev. 2.5, 2014-02-10
13 ** Extension to the CMSIS register access layer header.
15 ** Copyright (c) 2014 Freescale Semiconductor, Inc.
16 ** All rights reserved.
18 ** Redistribution and use in source and binary forms, with or without modification,
19 ** are permitted provided that the following conditions are met:
21 ** o Redistributions of source code must retain the above copyright notice, this list
22 ** of conditions and the following disclaimer.
24 ** o Redistributions in binary form must reproduce the above copyright notice, this
25 ** list of conditions and the following disclaimer in the documentation and/or
26 ** other materials provided with the distribution.
28 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
29 ** contributors may be used to endorse or promote products derived from this
30 ** software without specific prior written permission.
32 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
33 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
36 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
37 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
39 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 ** http: www.freescale.com
44 ** mail: support@freescale.com
47 ** - rev. 1.0 (2013-08-12)
49 ** - rev. 2.0 (2013-10-29)
50 ** Register accessor macros added to the memory map.
51 ** Symbols for Processor Expert memory map compatibility added to the memory map.
52 ** Startup file for gcc has been updated according to CMSIS 3.2.
53 ** System initialization updated.
54 ** MCG - registers updated.
55 ** PORTA, PORTB, PORTC, PORTE - registers for digital filter removed.
56 ** - rev. 2.1 (2013-10-30)
57 ** Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled.
58 ** - rev. 2.2 (2013-12-09)
59 ** DMA - EARS register removed.
60 ** AIPS0, AIPS1 - MPRA register updated.
61 ** - rev. 2.3 (2014-01-24)
62 ** Update according to reference manual rev. 2
63 ** ENET, MCG, MCM, SIM, USB - registers updated
64 ** - rev. 2.4 (2014-02-10)
65 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
66 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
67 ** - rev. 2.5 (2014-02-10)
68 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
69 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
70 ** Module access macro module_BASES replaced by module_BASE_PTRS.
72 ** ###################################################################
76 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
78 * This file was generated automatically and any changes may be lost.
80 #ifndef __HW_CMT_REGISTERS_H__
81 #define __HW_CMT_REGISTERS_H__
84 #include "fsl_bitaccess.h"
89 * Carrier Modulator Transmitter
91 * Registers defined in this header file:
92 * - HW_CMT_CGH1 - CMT Carrier Generator High Data Register 1
93 * - HW_CMT_CGL1 - CMT Carrier Generator Low Data Register 1
94 * - HW_CMT_CGH2 - CMT Carrier Generator High Data Register 2
95 * - HW_CMT_CGL2 - CMT Carrier Generator Low Data Register 2
96 * - HW_CMT_OC - CMT Output Control Register
97 * - HW_CMT_MSC - CMT Modulator Status and Control Register
98 * - HW_CMT_CMD1 - CMT Modulator Data Register Mark High
99 * - HW_CMT_CMD2 - CMT Modulator Data Register Mark Low
100 * - HW_CMT_CMD3 - CMT Modulator Data Register Space High
101 * - HW_CMT_CMD4 - CMT Modulator Data Register Space Low
102 * - HW_CMT_PPS - CMT Primary Prescaler Register
103 * - HW_CMT_DMA - CMT Direct Memory Access Register
105 * - hw_cmt_t - Struct containing all module registers.
108 #define HW_CMT_INSTANCE_COUNT (1U) /*!< Number of instances of the CMT module. */
110 /*******************************************************************************
111 * HW_CMT_CGH1 - CMT Carrier Generator High Data Register 1
112 ******************************************************************************/
115 * @brief HW_CMT_CGH1 - CMT Carrier Generator High Data Register 1 (RW)
119 * This data register contains the primary high value for generating the carrier
122 typedef union _hw_cmt_cgh1
125 struct _hw_cmt_cgh1_bitfields
127 uint8_t PH : 8; /*!< [7:0] Primary Carrier High Time Data Value */
132 * @name Constants and macros for entire CMT_CGH1 register
135 #define HW_CMT_CGH1_ADDR(x) ((x) + 0x0U)
137 #define HW_CMT_CGH1(x) (*(__IO hw_cmt_cgh1_t *) HW_CMT_CGH1_ADDR(x))
138 #define HW_CMT_CGH1_RD(x) (HW_CMT_CGH1(x).U)
139 #define HW_CMT_CGH1_WR(x, v) (HW_CMT_CGH1(x).U = (v))
140 #define HW_CMT_CGH1_SET(x, v) (HW_CMT_CGH1_WR(x, HW_CMT_CGH1_RD(x) | (v)))
141 #define HW_CMT_CGH1_CLR(x, v) (HW_CMT_CGH1_WR(x, HW_CMT_CGH1_RD(x) & ~(v)))
142 #define HW_CMT_CGH1_TOG(x, v) (HW_CMT_CGH1_WR(x, HW_CMT_CGH1_RD(x) ^ (v)))
146 * Constants & macros for individual CMT_CGH1 bitfields
150 * @name Register CMT_CGH1, field PH[7:0] (RW)
152 * Contains the number of input clocks required to generate the carrier high
153 * time period. When operating in Time mode, this register is always selected. When
154 * operating in FSK mode, this register and the secondary register pair are
155 * alternately selected under the control of the modulator. The primary carrier high
156 * time value is undefined out of reset. This register must be written to nonzero
157 * values before the carrier generator is enabled to avoid spurious results.
160 #define BP_CMT_CGH1_PH (0U) /*!< Bit position for CMT_CGH1_PH. */
161 #define BM_CMT_CGH1_PH (0xFFU) /*!< Bit mask for CMT_CGH1_PH. */
162 #define BS_CMT_CGH1_PH (8U) /*!< Bit field size in bits for CMT_CGH1_PH. */
164 /*! @brief Read current value of the CMT_CGH1_PH field. */
165 #define BR_CMT_CGH1_PH(x) (HW_CMT_CGH1(x).U)
167 /*! @brief Format value for bitfield CMT_CGH1_PH. */
168 #define BF_CMT_CGH1_PH(v) ((uint8_t)((uint8_t)(v) << BP_CMT_CGH1_PH) & BM_CMT_CGH1_PH)
170 /*! @brief Set the PH field to a new value. */
171 #define BW_CMT_CGH1_PH(x, v) (HW_CMT_CGH1_WR(x, v))
174 /*******************************************************************************
175 * HW_CMT_CGL1 - CMT Carrier Generator Low Data Register 1
176 ******************************************************************************/
179 * @brief HW_CMT_CGL1 - CMT Carrier Generator Low Data Register 1 (RW)
183 * This data register contains the primary low value for generating the carrier
186 typedef union _hw_cmt_cgl1
189 struct _hw_cmt_cgl1_bitfields
191 uint8_t PL : 8; /*!< [7:0] Primary Carrier Low Time Data Value */
196 * @name Constants and macros for entire CMT_CGL1 register
199 #define HW_CMT_CGL1_ADDR(x) ((x) + 0x1U)
201 #define HW_CMT_CGL1(x) (*(__IO hw_cmt_cgl1_t *) HW_CMT_CGL1_ADDR(x))
202 #define HW_CMT_CGL1_RD(x) (HW_CMT_CGL1(x).U)
203 #define HW_CMT_CGL1_WR(x, v) (HW_CMT_CGL1(x).U = (v))
204 #define HW_CMT_CGL1_SET(x, v) (HW_CMT_CGL1_WR(x, HW_CMT_CGL1_RD(x) | (v)))
205 #define HW_CMT_CGL1_CLR(x, v) (HW_CMT_CGL1_WR(x, HW_CMT_CGL1_RD(x) & ~(v)))
206 #define HW_CMT_CGL1_TOG(x, v) (HW_CMT_CGL1_WR(x, HW_CMT_CGL1_RD(x) ^ (v)))
210 * Constants & macros for individual CMT_CGL1 bitfields
214 * @name Register CMT_CGL1, field PL[7:0] (RW)
216 * Contains the number of input clocks required to generate the carrier low time
217 * period. When operating in Time mode, this register is always selected. When
218 * operating in FSK mode, this register and the secondary register pair are
219 * alternately selected under the control of the modulator. The primary carrier low
220 * time value is undefined out of reset. This register must be written to nonzero
221 * values before the carrier generator is enabled to avoid spurious results.
224 #define BP_CMT_CGL1_PL (0U) /*!< Bit position for CMT_CGL1_PL. */
225 #define BM_CMT_CGL1_PL (0xFFU) /*!< Bit mask for CMT_CGL1_PL. */
226 #define BS_CMT_CGL1_PL (8U) /*!< Bit field size in bits for CMT_CGL1_PL. */
228 /*! @brief Read current value of the CMT_CGL1_PL field. */
229 #define BR_CMT_CGL1_PL(x) (HW_CMT_CGL1(x).U)
231 /*! @brief Format value for bitfield CMT_CGL1_PL. */
232 #define BF_CMT_CGL1_PL(v) ((uint8_t)((uint8_t)(v) << BP_CMT_CGL1_PL) & BM_CMT_CGL1_PL)
234 /*! @brief Set the PL field to a new value. */
235 #define BW_CMT_CGL1_PL(x, v) (HW_CMT_CGL1_WR(x, v))
238 /*******************************************************************************
239 * HW_CMT_CGH2 - CMT Carrier Generator High Data Register 2
240 ******************************************************************************/
243 * @brief HW_CMT_CGH2 - CMT Carrier Generator High Data Register 2 (RW)
247 * This data register contains the secondary high value for generating the
250 typedef union _hw_cmt_cgh2
253 struct _hw_cmt_cgh2_bitfields
255 uint8_t SH : 8; /*!< [7:0] Secondary Carrier High Time Data Value */
260 * @name Constants and macros for entire CMT_CGH2 register
263 #define HW_CMT_CGH2_ADDR(x) ((x) + 0x2U)
265 #define HW_CMT_CGH2(x) (*(__IO hw_cmt_cgh2_t *) HW_CMT_CGH2_ADDR(x))
266 #define HW_CMT_CGH2_RD(x) (HW_CMT_CGH2(x).U)
267 #define HW_CMT_CGH2_WR(x, v) (HW_CMT_CGH2(x).U = (v))
268 #define HW_CMT_CGH2_SET(x, v) (HW_CMT_CGH2_WR(x, HW_CMT_CGH2_RD(x) | (v)))
269 #define HW_CMT_CGH2_CLR(x, v) (HW_CMT_CGH2_WR(x, HW_CMT_CGH2_RD(x) & ~(v)))
270 #define HW_CMT_CGH2_TOG(x, v) (HW_CMT_CGH2_WR(x, HW_CMT_CGH2_RD(x) ^ (v)))
274 * Constants & macros for individual CMT_CGH2 bitfields
278 * @name Register CMT_CGH2, field SH[7:0] (RW)
280 * Contains the number of input clocks required to generate the carrier high
281 * time period. When operating in Time mode, this register is never selected. When
282 * operating in FSK mode, this register and the primary register pair are
283 * alternately selected under control of the modulator. The secondary carrier high time
284 * value is undefined out of reset. This register must be written to nonzero
285 * values before the carrier generator is enabled when operating in FSK mode.
288 #define BP_CMT_CGH2_SH (0U) /*!< Bit position for CMT_CGH2_SH. */
289 #define BM_CMT_CGH2_SH (0xFFU) /*!< Bit mask for CMT_CGH2_SH. */
290 #define BS_CMT_CGH2_SH (8U) /*!< Bit field size in bits for CMT_CGH2_SH. */
292 /*! @brief Read current value of the CMT_CGH2_SH field. */
293 #define BR_CMT_CGH2_SH(x) (HW_CMT_CGH2(x).U)
295 /*! @brief Format value for bitfield CMT_CGH2_SH. */
296 #define BF_CMT_CGH2_SH(v) ((uint8_t)((uint8_t)(v) << BP_CMT_CGH2_SH) & BM_CMT_CGH2_SH)
298 /*! @brief Set the SH field to a new value. */
299 #define BW_CMT_CGH2_SH(x, v) (HW_CMT_CGH2_WR(x, v))
302 /*******************************************************************************
303 * HW_CMT_CGL2 - CMT Carrier Generator Low Data Register 2
304 ******************************************************************************/
307 * @brief HW_CMT_CGL2 - CMT Carrier Generator Low Data Register 2 (RW)
311 * This data register contains the secondary low value for generating the
314 typedef union _hw_cmt_cgl2
317 struct _hw_cmt_cgl2_bitfields
319 uint8_t SL : 8; /*!< [7:0] Secondary Carrier Low Time Data Value */
324 * @name Constants and macros for entire CMT_CGL2 register
327 #define HW_CMT_CGL2_ADDR(x) ((x) + 0x3U)
329 #define HW_CMT_CGL2(x) (*(__IO hw_cmt_cgl2_t *) HW_CMT_CGL2_ADDR(x))
330 #define HW_CMT_CGL2_RD(x) (HW_CMT_CGL2(x).U)
331 #define HW_CMT_CGL2_WR(x, v) (HW_CMT_CGL2(x).U = (v))
332 #define HW_CMT_CGL2_SET(x, v) (HW_CMT_CGL2_WR(x, HW_CMT_CGL2_RD(x) | (v)))
333 #define HW_CMT_CGL2_CLR(x, v) (HW_CMT_CGL2_WR(x, HW_CMT_CGL2_RD(x) & ~(v)))
334 #define HW_CMT_CGL2_TOG(x, v) (HW_CMT_CGL2_WR(x, HW_CMT_CGL2_RD(x) ^ (v)))
338 * Constants & macros for individual CMT_CGL2 bitfields
342 * @name Register CMT_CGL2, field SL[7:0] (RW)
344 * Contains the number of input clocks required to generate the carrier low time
345 * period. When operating in Time mode, this register is never selected. When
346 * operating in FSK mode, this register and the primary register pair are
347 * alternately selected under the control of the modulator. The secondary carrier low time
348 * value is undefined out of reset. This register must be written to nonzero
349 * values before the carrier generator is enabled when operating in FSK mode.
352 #define BP_CMT_CGL2_SL (0U) /*!< Bit position for CMT_CGL2_SL. */
353 #define BM_CMT_CGL2_SL (0xFFU) /*!< Bit mask for CMT_CGL2_SL. */
354 #define BS_CMT_CGL2_SL (8U) /*!< Bit field size in bits for CMT_CGL2_SL. */
356 /*! @brief Read current value of the CMT_CGL2_SL field. */
357 #define BR_CMT_CGL2_SL(x) (HW_CMT_CGL2(x).U)
359 /*! @brief Format value for bitfield CMT_CGL2_SL. */
360 #define BF_CMT_CGL2_SL(v) ((uint8_t)((uint8_t)(v) << BP_CMT_CGL2_SL) & BM_CMT_CGL2_SL)
362 /*! @brief Set the SL field to a new value. */
363 #define BW_CMT_CGL2_SL(x, v) (HW_CMT_CGL2_WR(x, v))
366 /*******************************************************************************
367 * HW_CMT_OC - CMT Output Control Register
368 ******************************************************************************/
371 * @brief HW_CMT_OC - CMT Output Control Register (RW)
375 * This register is used to control the IRO signal of the CMT module.
377 typedef union _hw_cmt_oc
380 struct _hw_cmt_oc_bitfields
382 uint8_t RESERVED0 : 5; /*!< [4:0] */
383 uint8_t IROPEN : 1; /*!< [5] IRO Pin Enable */
384 uint8_t CMTPOL : 1; /*!< [6] CMT Output Polarity */
385 uint8_t IROL : 1; /*!< [7] IRO Latch Control */
390 * @name Constants and macros for entire CMT_OC register
393 #define HW_CMT_OC_ADDR(x) ((x) + 0x4U)
395 #define HW_CMT_OC(x) (*(__IO hw_cmt_oc_t *) HW_CMT_OC_ADDR(x))
396 #define HW_CMT_OC_RD(x) (HW_CMT_OC(x).U)
397 #define HW_CMT_OC_WR(x, v) (HW_CMT_OC(x).U = (v))
398 #define HW_CMT_OC_SET(x, v) (HW_CMT_OC_WR(x, HW_CMT_OC_RD(x) | (v)))
399 #define HW_CMT_OC_CLR(x, v) (HW_CMT_OC_WR(x, HW_CMT_OC_RD(x) & ~(v)))
400 #define HW_CMT_OC_TOG(x, v) (HW_CMT_OC_WR(x, HW_CMT_OC_RD(x) ^ (v)))
404 * Constants & macros for individual CMT_OC bitfields
408 * @name Register CMT_OC, field IROPEN[5] (RW)
410 * Enables and disables the IRO signal. When the IRO signal is enabled, it is an
411 * output that drives out either the CMT transmitter output or the state of IROL
412 * depending on whether MSC[MCGEN] is set or not. Also, the state of output is
413 * either inverted or non-inverted, depending on the state of CMTPOL. When the IRO
414 * signal is disabled, it is in a high-impedance state and is unable to draw any
415 * current. This signal is disabled during reset.
418 * - 0 - The IRO signal is disabled.
419 * - 1 - The IRO signal is enabled as output.
422 #define BP_CMT_OC_IROPEN (5U) /*!< Bit position for CMT_OC_IROPEN. */
423 #define BM_CMT_OC_IROPEN (0x20U) /*!< Bit mask for CMT_OC_IROPEN. */
424 #define BS_CMT_OC_IROPEN (1U) /*!< Bit field size in bits for CMT_OC_IROPEN. */
426 /*! @brief Read current value of the CMT_OC_IROPEN field. */
427 #define BR_CMT_OC_IROPEN(x) (BITBAND_ACCESS8(HW_CMT_OC_ADDR(x), BP_CMT_OC_IROPEN))
429 /*! @brief Format value for bitfield CMT_OC_IROPEN. */
430 #define BF_CMT_OC_IROPEN(v) ((uint8_t)((uint8_t)(v) << BP_CMT_OC_IROPEN) & BM_CMT_OC_IROPEN)
432 /*! @brief Set the IROPEN field to a new value. */
433 #define BW_CMT_OC_IROPEN(x, v) (BITBAND_ACCESS8(HW_CMT_OC_ADDR(x), BP_CMT_OC_IROPEN) = (v))
437 * @name Register CMT_OC, field CMTPOL[6] (RW)
439 * Controls the polarity of the IRO signal.
442 * - 0 - The IRO signal is active-low.
443 * - 1 - The IRO signal is active-high.
446 #define BP_CMT_OC_CMTPOL (6U) /*!< Bit position for CMT_OC_CMTPOL. */
447 #define BM_CMT_OC_CMTPOL (0x40U) /*!< Bit mask for CMT_OC_CMTPOL. */
448 #define BS_CMT_OC_CMTPOL (1U) /*!< Bit field size in bits for CMT_OC_CMTPOL. */
450 /*! @brief Read current value of the CMT_OC_CMTPOL field. */
451 #define BR_CMT_OC_CMTPOL(x) (BITBAND_ACCESS8(HW_CMT_OC_ADDR(x), BP_CMT_OC_CMTPOL))
453 /*! @brief Format value for bitfield CMT_OC_CMTPOL. */
454 #define BF_CMT_OC_CMTPOL(v) ((uint8_t)((uint8_t)(v) << BP_CMT_OC_CMTPOL) & BM_CMT_OC_CMTPOL)
456 /*! @brief Set the CMTPOL field to a new value. */
457 #define BW_CMT_OC_CMTPOL(x, v) (BITBAND_ACCESS8(HW_CMT_OC_ADDR(x), BP_CMT_OC_CMTPOL) = (v))
461 * @name Register CMT_OC, field IROL[7] (RW)
463 * Reads the state of the IRO latch. Writing to IROL changes the state of the
464 * IRO signal when MSC[MCGEN] is cleared and IROPEN is set.
467 #define BP_CMT_OC_IROL (7U) /*!< Bit position for CMT_OC_IROL. */
468 #define BM_CMT_OC_IROL (0x80U) /*!< Bit mask for CMT_OC_IROL. */
469 #define BS_CMT_OC_IROL (1U) /*!< Bit field size in bits for CMT_OC_IROL. */
471 /*! @brief Read current value of the CMT_OC_IROL field. */
472 #define BR_CMT_OC_IROL(x) (BITBAND_ACCESS8(HW_CMT_OC_ADDR(x), BP_CMT_OC_IROL))
474 /*! @brief Format value for bitfield CMT_OC_IROL. */
475 #define BF_CMT_OC_IROL(v) ((uint8_t)((uint8_t)(v) << BP_CMT_OC_IROL) & BM_CMT_OC_IROL)
477 /*! @brief Set the IROL field to a new value. */
478 #define BW_CMT_OC_IROL(x, v) (BITBAND_ACCESS8(HW_CMT_OC_ADDR(x), BP_CMT_OC_IROL) = (v))
481 /*******************************************************************************
482 * HW_CMT_MSC - CMT Modulator Status and Control Register
483 ******************************************************************************/
486 * @brief HW_CMT_MSC - CMT Modulator Status and Control Register (RW)
490 * This register contains the modulator and carrier generator enable (MCGEN),
491 * end of cycle interrupt enable (EOCIE), FSK mode select (FSK), baseband enable
492 * (BASE), extended space (EXSPC), prescaler (CMTDIV) bits, and the end of cycle
495 typedef union _hw_cmt_msc
498 struct _hw_cmt_msc_bitfields
500 uint8_t MCGEN : 1; /*!< [0] Modulator and Carrier Generator Enable */
501 uint8_t EOCIE : 1; /*!< [1] End of Cycle Interrupt Enable */
502 uint8_t FSK : 1; /*!< [2] FSK Mode Select */
503 uint8_t BASE : 1; /*!< [3] Baseband Enable */
504 uint8_t EXSPC : 1; /*!< [4] Extended Space Enable */
505 uint8_t CMTDIV : 2; /*!< [6:5] CMT Clock Divide Prescaler */
506 uint8_t EOCF : 1; /*!< [7] End Of Cycle Status Flag */
511 * @name Constants and macros for entire CMT_MSC register
514 #define HW_CMT_MSC_ADDR(x) ((x) + 0x5U)
516 #define HW_CMT_MSC(x) (*(__IO hw_cmt_msc_t *) HW_CMT_MSC_ADDR(x))
517 #define HW_CMT_MSC_RD(x) (HW_CMT_MSC(x).U)
518 #define HW_CMT_MSC_WR(x, v) (HW_CMT_MSC(x).U = (v))
519 #define HW_CMT_MSC_SET(x, v) (HW_CMT_MSC_WR(x, HW_CMT_MSC_RD(x) | (v)))
520 #define HW_CMT_MSC_CLR(x, v) (HW_CMT_MSC_WR(x, HW_CMT_MSC_RD(x) & ~(v)))
521 #define HW_CMT_MSC_TOG(x, v) (HW_CMT_MSC_WR(x, HW_CMT_MSC_RD(x) ^ (v)))
525 * Constants & macros for individual CMT_MSC bitfields
529 * @name Register CMT_MSC, field MCGEN[0] (RW)
531 * Setting MCGEN will initialize the carrier generator and modulator and will
532 * enable all clocks. When enabled, the carrier generator and modulator will
533 * function continuously. When MCGEN is cleared, the current modulator cycle will be
534 * allowed to expire before all carrier and modulator clocks are disabled to save
535 * power and the modulator output is forced low. To prevent spurious operation,
536 * the user should initialize all data and control registers before enabling the
540 * - 0 - Modulator and carrier generator disabled
541 * - 1 - Modulator and carrier generator enabled
544 #define BP_CMT_MSC_MCGEN (0U) /*!< Bit position for CMT_MSC_MCGEN. */
545 #define BM_CMT_MSC_MCGEN (0x01U) /*!< Bit mask for CMT_MSC_MCGEN. */
546 #define BS_CMT_MSC_MCGEN (1U) /*!< Bit field size in bits for CMT_MSC_MCGEN. */
548 /*! @brief Read current value of the CMT_MSC_MCGEN field. */
549 #define BR_CMT_MSC_MCGEN(x) (BITBAND_ACCESS8(HW_CMT_MSC_ADDR(x), BP_CMT_MSC_MCGEN))
551 /*! @brief Format value for bitfield CMT_MSC_MCGEN. */
552 #define BF_CMT_MSC_MCGEN(v) ((uint8_t)((uint8_t)(v) << BP_CMT_MSC_MCGEN) & BM_CMT_MSC_MCGEN)
554 /*! @brief Set the MCGEN field to a new value. */
555 #define BW_CMT_MSC_MCGEN(x, v) (BITBAND_ACCESS8(HW_CMT_MSC_ADDR(x), BP_CMT_MSC_MCGEN) = (v))
559 * @name Register CMT_MSC, field EOCIE[1] (RW)
561 * Requests to enable a CPU interrupt when EOCF is set if EOCIE is high.
564 * - 0 - CPU interrupt is disabled.
565 * - 1 - CPU interrupt is enabled.
568 #define BP_CMT_MSC_EOCIE (1U) /*!< Bit position for CMT_MSC_EOCIE. */
569 #define BM_CMT_MSC_EOCIE (0x02U) /*!< Bit mask for CMT_MSC_EOCIE. */
570 #define BS_CMT_MSC_EOCIE (1U) /*!< Bit field size in bits for CMT_MSC_EOCIE. */
572 /*! @brief Read current value of the CMT_MSC_EOCIE field. */
573 #define BR_CMT_MSC_EOCIE(x) (BITBAND_ACCESS8(HW_CMT_MSC_ADDR(x), BP_CMT_MSC_EOCIE))
575 /*! @brief Format value for bitfield CMT_MSC_EOCIE. */
576 #define BF_CMT_MSC_EOCIE(v) ((uint8_t)((uint8_t)(v) << BP_CMT_MSC_EOCIE) & BM_CMT_MSC_EOCIE)
578 /*! @brief Set the EOCIE field to a new value. */
579 #define BW_CMT_MSC_EOCIE(x, v) (BITBAND_ACCESS8(HW_CMT_MSC_ADDR(x), BP_CMT_MSC_EOCIE) = (v))
583 * @name Register CMT_MSC, field FSK[2] (RW)
585 * Enables FSK operation.
588 * - 0 - The CMT operates in Time or Baseband mode.
589 * - 1 - The CMT operates in FSK mode.
592 #define BP_CMT_MSC_FSK (2U) /*!< Bit position for CMT_MSC_FSK. */
593 #define BM_CMT_MSC_FSK (0x04U) /*!< Bit mask for CMT_MSC_FSK. */
594 #define BS_CMT_MSC_FSK (1U) /*!< Bit field size in bits for CMT_MSC_FSK. */
596 /*! @brief Read current value of the CMT_MSC_FSK field. */
597 #define BR_CMT_MSC_FSK(x) (BITBAND_ACCESS8(HW_CMT_MSC_ADDR(x), BP_CMT_MSC_FSK))
599 /*! @brief Format value for bitfield CMT_MSC_FSK. */
600 #define BF_CMT_MSC_FSK(v) ((uint8_t)((uint8_t)(v) << BP_CMT_MSC_FSK) & BM_CMT_MSC_FSK)
602 /*! @brief Set the FSK field to a new value. */
603 #define BW_CMT_MSC_FSK(x, v) (BITBAND_ACCESS8(HW_CMT_MSC_ADDR(x), BP_CMT_MSC_FSK) = (v))
607 * @name Register CMT_MSC, field BASE[3] (RW)
609 * When set, BASE disables the carrier generator and forces the carrier output
610 * high for generation of baseband protocols. When BASE is cleared, the carrier
611 * generator is enabled and the carrier output toggles at the frequency determined
612 * by values stored in the carrier data registers. This field is cleared by
613 * reset. This field is not double-buffered and must not be written to during a
617 * - 0 - Baseband mode is disabled.
618 * - 1 - Baseband mode is enabled.
621 #define BP_CMT_MSC_BASE (3U) /*!< Bit position for CMT_MSC_BASE. */
622 #define BM_CMT_MSC_BASE (0x08U) /*!< Bit mask for CMT_MSC_BASE. */
623 #define BS_CMT_MSC_BASE (1U) /*!< Bit field size in bits for CMT_MSC_BASE. */
625 /*! @brief Read current value of the CMT_MSC_BASE field. */
626 #define BR_CMT_MSC_BASE(x) (BITBAND_ACCESS8(HW_CMT_MSC_ADDR(x), BP_CMT_MSC_BASE))
628 /*! @brief Format value for bitfield CMT_MSC_BASE. */
629 #define BF_CMT_MSC_BASE(v) ((uint8_t)((uint8_t)(v) << BP_CMT_MSC_BASE) & BM_CMT_MSC_BASE)
631 /*! @brief Set the BASE field to a new value. */
632 #define BW_CMT_MSC_BASE(x, v) (BITBAND_ACCESS8(HW_CMT_MSC_ADDR(x), BP_CMT_MSC_BASE) = (v))
636 * @name Register CMT_MSC, field EXSPC[4] (RW)
638 * Enables the extended space operation.
641 * - 0 - Extended space is disabled.
642 * - 1 - Extended space is enabled.
645 #define BP_CMT_MSC_EXSPC (4U) /*!< Bit position for CMT_MSC_EXSPC. */
646 #define BM_CMT_MSC_EXSPC (0x10U) /*!< Bit mask for CMT_MSC_EXSPC. */
647 #define BS_CMT_MSC_EXSPC (1U) /*!< Bit field size in bits for CMT_MSC_EXSPC. */
649 /*! @brief Read current value of the CMT_MSC_EXSPC field. */
650 #define BR_CMT_MSC_EXSPC(x) (BITBAND_ACCESS8(HW_CMT_MSC_ADDR(x), BP_CMT_MSC_EXSPC))
652 /*! @brief Format value for bitfield CMT_MSC_EXSPC. */
653 #define BF_CMT_MSC_EXSPC(v) ((uint8_t)((uint8_t)(v) << BP_CMT_MSC_EXSPC) & BM_CMT_MSC_EXSPC)
655 /*! @brief Set the EXSPC field to a new value. */
656 #define BW_CMT_MSC_EXSPC(x, v) (BITBAND_ACCESS8(HW_CMT_MSC_ADDR(x), BP_CMT_MSC_EXSPC) = (v))
660 * @name Register CMT_MSC, field CMTDIV[6:5] (RW)
662 * Causes the CMT to be clocked at the IF signal frequency, or the IF frequency
663 * divided by 2 ,4, or 8 . This field must not be changed during a transmission
664 * because it is not double-buffered.
673 #define BP_CMT_MSC_CMTDIV (5U) /*!< Bit position for CMT_MSC_CMTDIV. */
674 #define BM_CMT_MSC_CMTDIV (0x60U) /*!< Bit mask for CMT_MSC_CMTDIV. */
675 #define BS_CMT_MSC_CMTDIV (2U) /*!< Bit field size in bits for CMT_MSC_CMTDIV. */
677 /*! @brief Read current value of the CMT_MSC_CMTDIV field. */
678 #define BR_CMT_MSC_CMTDIV(x) (HW_CMT_MSC(x).B.CMTDIV)
680 /*! @brief Format value for bitfield CMT_MSC_CMTDIV. */
681 #define BF_CMT_MSC_CMTDIV(v) ((uint8_t)((uint8_t)(v) << BP_CMT_MSC_CMTDIV) & BM_CMT_MSC_CMTDIV)
683 /*! @brief Set the CMTDIV field to a new value. */
684 #define BW_CMT_MSC_CMTDIV(x, v) (HW_CMT_MSC_WR(x, (HW_CMT_MSC_RD(x) & ~BM_CMT_MSC_CMTDIV) | BF_CMT_MSC_CMTDIV(v)))
688 * @name Register CMT_MSC, field EOCF[7] (RO)
690 * Sets when: The modulator is not currently active and MCGEN is set to begin
691 * the initial CMT transmission. At the end of each modulation cycle while MCGEN is
692 * set. This is recognized when a match occurs between the contents of the space
693 * period register and the down counter. At this time, the counter is
694 * initialized with, possibly new contents of the mark period buffer, CMD1 and CMD2, and
695 * the space period register is loaded with, possibly new contents of the space
696 * period buffer, CMD3 and CMD4. This flag is cleared by reading MSC followed by an
697 * access of CMD2 or CMD4, or by the DMA transfer.
700 * - 0 - End of modulation cycle has not occured since the flag last cleared.
701 * - 1 - End of modulator cycle has occurred.
704 #define BP_CMT_MSC_EOCF (7U) /*!< Bit position for CMT_MSC_EOCF. */
705 #define BM_CMT_MSC_EOCF (0x80U) /*!< Bit mask for CMT_MSC_EOCF. */
706 #define BS_CMT_MSC_EOCF (1U) /*!< Bit field size in bits for CMT_MSC_EOCF. */
708 /*! @brief Read current value of the CMT_MSC_EOCF field. */
709 #define BR_CMT_MSC_EOCF(x) (BITBAND_ACCESS8(HW_CMT_MSC_ADDR(x), BP_CMT_MSC_EOCF))
712 /*******************************************************************************
713 * HW_CMT_CMD1 - CMT Modulator Data Register Mark High
714 ******************************************************************************/
717 * @brief HW_CMT_CMD1 - CMT Modulator Data Register Mark High (RW)
721 * The contents of this register are transferred to the modulator down counter
722 * upon the completion of a modulation period.
724 typedef union _hw_cmt_cmd1
727 struct _hw_cmt_cmd1_bitfields
729 uint8_t MB : 8; /*!< [7:0] */
734 * @name Constants and macros for entire CMT_CMD1 register
737 #define HW_CMT_CMD1_ADDR(x) ((x) + 0x6U)
739 #define HW_CMT_CMD1(x) (*(__IO hw_cmt_cmd1_t *) HW_CMT_CMD1_ADDR(x))
740 #define HW_CMT_CMD1_RD(x) (HW_CMT_CMD1(x).U)
741 #define HW_CMT_CMD1_WR(x, v) (HW_CMT_CMD1(x).U = (v))
742 #define HW_CMT_CMD1_SET(x, v) (HW_CMT_CMD1_WR(x, HW_CMT_CMD1_RD(x) | (v)))
743 #define HW_CMT_CMD1_CLR(x, v) (HW_CMT_CMD1_WR(x, HW_CMT_CMD1_RD(x) & ~(v)))
744 #define HW_CMT_CMD1_TOG(x, v) (HW_CMT_CMD1_WR(x, HW_CMT_CMD1_RD(x) ^ (v)))
748 * Constants & macros for individual CMT_CMD1 bitfields
752 * @name Register CMT_CMD1, field MB[7:0] (RW)
754 * Controls the upper mark periods of the modulator for all modes.
757 #define BP_CMT_CMD1_MB (0U) /*!< Bit position for CMT_CMD1_MB. */
758 #define BM_CMT_CMD1_MB (0xFFU) /*!< Bit mask for CMT_CMD1_MB. */
759 #define BS_CMT_CMD1_MB (8U) /*!< Bit field size in bits for CMT_CMD1_MB. */
761 /*! @brief Read current value of the CMT_CMD1_MB field. */
762 #define BR_CMT_CMD1_MB(x) (HW_CMT_CMD1(x).U)
764 /*! @brief Format value for bitfield CMT_CMD1_MB. */
765 #define BF_CMT_CMD1_MB(v) ((uint8_t)((uint8_t)(v) << BP_CMT_CMD1_MB) & BM_CMT_CMD1_MB)
767 /*! @brief Set the MB field to a new value. */
768 #define BW_CMT_CMD1_MB(x, v) (HW_CMT_CMD1_WR(x, v))
771 /*******************************************************************************
772 * HW_CMT_CMD2 - CMT Modulator Data Register Mark Low
773 ******************************************************************************/
776 * @brief HW_CMT_CMD2 - CMT Modulator Data Register Mark Low (RW)
780 * The contents of this register are transferred to the modulator down counter
781 * upon the completion of a modulation period.
783 typedef union _hw_cmt_cmd2
786 struct _hw_cmt_cmd2_bitfields
788 uint8_t MB : 8; /*!< [7:0] */
793 * @name Constants and macros for entire CMT_CMD2 register
796 #define HW_CMT_CMD2_ADDR(x) ((x) + 0x7U)
798 #define HW_CMT_CMD2(x) (*(__IO hw_cmt_cmd2_t *) HW_CMT_CMD2_ADDR(x))
799 #define HW_CMT_CMD2_RD(x) (HW_CMT_CMD2(x).U)
800 #define HW_CMT_CMD2_WR(x, v) (HW_CMT_CMD2(x).U = (v))
801 #define HW_CMT_CMD2_SET(x, v) (HW_CMT_CMD2_WR(x, HW_CMT_CMD2_RD(x) | (v)))
802 #define HW_CMT_CMD2_CLR(x, v) (HW_CMT_CMD2_WR(x, HW_CMT_CMD2_RD(x) & ~(v)))
803 #define HW_CMT_CMD2_TOG(x, v) (HW_CMT_CMD2_WR(x, HW_CMT_CMD2_RD(x) ^ (v)))
807 * Constants & macros for individual CMT_CMD2 bitfields
811 * @name Register CMT_CMD2, field MB[7:0] (RW)
813 * Controls the lower mark periods of the modulator for all modes.
816 #define BP_CMT_CMD2_MB (0U) /*!< Bit position for CMT_CMD2_MB. */
817 #define BM_CMT_CMD2_MB (0xFFU) /*!< Bit mask for CMT_CMD2_MB. */
818 #define BS_CMT_CMD2_MB (8U) /*!< Bit field size in bits for CMT_CMD2_MB. */
820 /*! @brief Read current value of the CMT_CMD2_MB field. */
821 #define BR_CMT_CMD2_MB(x) (HW_CMT_CMD2(x).U)
823 /*! @brief Format value for bitfield CMT_CMD2_MB. */
824 #define BF_CMT_CMD2_MB(v) ((uint8_t)((uint8_t)(v) << BP_CMT_CMD2_MB) & BM_CMT_CMD2_MB)
826 /*! @brief Set the MB field to a new value. */
827 #define BW_CMT_CMD2_MB(x, v) (HW_CMT_CMD2_WR(x, v))
830 /*******************************************************************************
831 * HW_CMT_CMD3 - CMT Modulator Data Register Space High
832 ******************************************************************************/
835 * @brief HW_CMT_CMD3 - CMT Modulator Data Register Space High (RW)
839 * The contents of this register are transferred to the space period register
840 * upon the completion of a modulation period.
842 typedef union _hw_cmt_cmd3
845 struct _hw_cmt_cmd3_bitfields
847 uint8_t SB : 8; /*!< [7:0] */
852 * @name Constants and macros for entire CMT_CMD3 register
855 #define HW_CMT_CMD3_ADDR(x) ((x) + 0x8U)
857 #define HW_CMT_CMD3(x) (*(__IO hw_cmt_cmd3_t *) HW_CMT_CMD3_ADDR(x))
858 #define HW_CMT_CMD3_RD(x) (HW_CMT_CMD3(x).U)
859 #define HW_CMT_CMD3_WR(x, v) (HW_CMT_CMD3(x).U = (v))
860 #define HW_CMT_CMD3_SET(x, v) (HW_CMT_CMD3_WR(x, HW_CMT_CMD3_RD(x) | (v)))
861 #define HW_CMT_CMD3_CLR(x, v) (HW_CMT_CMD3_WR(x, HW_CMT_CMD3_RD(x) & ~(v)))
862 #define HW_CMT_CMD3_TOG(x, v) (HW_CMT_CMD3_WR(x, HW_CMT_CMD3_RD(x) ^ (v)))
866 * Constants & macros for individual CMT_CMD3 bitfields
870 * @name Register CMT_CMD3, field SB[7:0] (RW)
872 * Controls the upper space periods of the modulator for all modes.
875 #define BP_CMT_CMD3_SB (0U) /*!< Bit position for CMT_CMD3_SB. */
876 #define BM_CMT_CMD3_SB (0xFFU) /*!< Bit mask for CMT_CMD3_SB. */
877 #define BS_CMT_CMD3_SB (8U) /*!< Bit field size in bits for CMT_CMD3_SB. */
879 /*! @brief Read current value of the CMT_CMD3_SB field. */
880 #define BR_CMT_CMD3_SB(x) (HW_CMT_CMD3(x).U)
882 /*! @brief Format value for bitfield CMT_CMD3_SB. */
883 #define BF_CMT_CMD3_SB(v) ((uint8_t)((uint8_t)(v) << BP_CMT_CMD3_SB) & BM_CMT_CMD3_SB)
885 /*! @brief Set the SB field to a new value. */
886 #define BW_CMT_CMD3_SB(x, v) (HW_CMT_CMD3_WR(x, v))
889 /*******************************************************************************
890 * HW_CMT_CMD4 - CMT Modulator Data Register Space Low
891 ******************************************************************************/
894 * @brief HW_CMT_CMD4 - CMT Modulator Data Register Space Low (RW)
898 * The contents of this register are transferred to the space period register
899 * upon the completion of a modulation period.
901 typedef union _hw_cmt_cmd4
904 struct _hw_cmt_cmd4_bitfields
906 uint8_t SB : 8; /*!< [7:0] */
911 * @name Constants and macros for entire CMT_CMD4 register
914 #define HW_CMT_CMD4_ADDR(x) ((x) + 0x9U)
916 #define HW_CMT_CMD4(x) (*(__IO hw_cmt_cmd4_t *) HW_CMT_CMD4_ADDR(x))
917 #define HW_CMT_CMD4_RD(x) (HW_CMT_CMD4(x).U)
918 #define HW_CMT_CMD4_WR(x, v) (HW_CMT_CMD4(x).U = (v))
919 #define HW_CMT_CMD4_SET(x, v) (HW_CMT_CMD4_WR(x, HW_CMT_CMD4_RD(x) | (v)))
920 #define HW_CMT_CMD4_CLR(x, v) (HW_CMT_CMD4_WR(x, HW_CMT_CMD4_RD(x) & ~(v)))
921 #define HW_CMT_CMD4_TOG(x, v) (HW_CMT_CMD4_WR(x, HW_CMT_CMD4_RD(x) ^ (v)))
925 * Constants & macros for individual CMT_CMD4 bitfields
929 * @name Register CMT_CMD4, field SB[7:0] (RW)
931 * Controls the lower space periods of the modulator for all modes.
934 #define BP_CMT_CMD4_SB (0U) /*!< Bit position for CMT_CMD4_SB. */
935 #define BM_CMT_CMD4_SB (0xFFU) /*!< Bit mask for CMT_CMD4_SB. */
936 #define BS_CMT_CMD4_SB (8U) /*!< Bit field size in bits for CMT_CMD4_SB. */
938 /*! @brief Read current value of the CMT_CMD4_SB field. */
939 #define BR_CMT_CMD4_SB(x) (HW_CMT_CMD4(x).U)
941 /*! @brief Format value for bitfield CMT_CMD4_SB. */
942 #define BF_CMT_CMD4_SB(v) ((uint8_t)((uint8_t)(v) << BP_CMT_CMD4_SB) & BM_CMT_CMD4_SB)
944 /*! @brief Set the SB field to a new value. */
945 #define BW_CMT_CMD4_SB(x, v) (HW_CMT_CMD4_WR(x, v))
948 /*******************************************************************************
949 * HW_CMT_PPS - CMT Primary Prescaler Register
950 ******************************************************************************/
953 * @brief HW_CMT_PPS - CMT Primary Prescaler Register (RW)
957 * This register is used to set the Primary Prescaler Divider field (PPSDIV).
959 typedef union _hw_cmt_pps
962 struct _hw_cmt_pps_bitfields
964 uint8_t PPSDIV : 4; /*!< [3:0] Primary Prescaler Divider */
965 uint8_t RESERVED0 : 4; /*!< [7:4] */
970 * @name Constants and macros for entire CMT_PPS register
973 #define HW_CMT_PPS_ADDR(x) ((x) + 0xAU)
975 #define HW_CMT_PPS(x) (*(__IO hw_cmt_pps_t *) HW_CMT_PPS_ADDR(x))
976 #define HW_CMT_PPS_RD(x) (HW_CMT_PPS(x).U)
977 #define HW_CMT_PPS_WR(x, v) (HW_CMT_PPS(x).U = (v))
978 #define HW_CMT_PPS_SET(x, v) (HW_CMT_PPS_WR(x, HW_CMT_PPS_RD(x) | (v)))
979 #define HW_CMT_PPS_CLR(x, v) (HW_CMT_PPS_WR(x, HW_CMT_PPS_RD(x) & ~(v)))
980 #define HW_CMT_PPS_TOG(x, v) (HW_CMT_PPS_WR(x, HW_CMT_PPS_RD(x) ^ (v)))
984 * Constants & macros for individual CMT_PPS bitfields
988 * @name Register CMT_PPS, field PPSDIV[3:0] (RW)
990 * Divides the CMT clock to generate the Intermediate Frequency clock enable to
991 * the secondary prescaler.
994 * - 0000 - Bus clock * 1
995 * - 0001 - Bus clock * 2
996 * - 0010 - Bus clock * 3
997 * - 0011 - Bus clock * 4
998 * - 0100 - Bus clock * 5
999 * - 0101 - Bus clock * 6
1000 * - 0110 - Bus clock * 7
1001 * - 0111 - Bus clock * 8
1002 * - 1000 - Bus clock * 9
1003 * - 1001 - Bus clock * 10
1004 * - 1010 - Bus clock * 11
1005 * - 1011 - Bus clock * 12
1006 * - 1100 - Bus clock * 13
1007 * - 1101 - Bus clock * 14
1008 * - 1110 - Bus clock * 15
1009 * - 1111 - Bus clock * 16
1012 #define BP_CMT_PPS_PPSDIV (0U) /*!< Bit position for CMT_PPS_PPSDIV. */
1013 #define BM_CMT_PPS_PPSDIV (0x0FU) /*!< Bit mask for CMT_PPS_PPSDIV. */
1014 #define BS_CMT_PPS_PPSDIV (4U) /*!< Bit field size in bits for CMT_PPS_PPSDIV. */
1016 /*! @brief Read current value of the CMT_PPS_PPSDIV field. */
1017 #define BR_CMT_PPS_PPSDIV(x) (HW_CMT_PPS(x).B.PPSDIV)
1019 /*! @brief Format value for bitfield CMT_PPS_PPSDIV. */
1020 #define BF_CMT_PPS_PPSDIV(v) ((uint8_t)((uint8_t)(v) << BP_CMT_PPS_PPSDIV) & BM_CMT_PPS_PPSDIV)
1022 /*! @brief Set the PPSDIV field to a new value. */
1023 #define BW_CMT_PPS_PPSDIV(x, v) (HW_CMT_PPS_WR(x, (HW_CMT_PPS_RD(x) & ~BM_CMT_PPS_PPSDIV) | BF_CMT_PPS_PPSDIV(v)))
1026 /*******************************************************************************
1027 * HW_CMT_DMA - CMT Direct Memory Access Register
1028 ******************************************************************************/
1031 * @brief HW_CMT_DMA - CMT Direct Memory Access Register (RW)
1033 * Reset value: 0x00U
1035 * This register is used to enable/disable direct memory access (DMA).
1037 typedef union _hw_cmt_dma
1040 struct _hw_cmt_dma_bitfields
1042 uint8_t DMA : 1; /*!< [0] DMA Enable */
1043 uint8_t RESERVED0 : 7; /*!< [7:1] */
1048 * @name Constants and macros for entire CMT_DMA register
1051 #define HW_CMT_DMA_ADDR(x) ((x) + 0xBU)
1053 #define HW_CMT_DMA(x) (*(__IO hw_cmt_dma_t *) HW_CMT_DMA_ADDR(x))
1054 #define HW_CMT_DMA_RD(x) (HW_CMT_DMA(x).U)
1055 #define HW_CMT_DMA_WR(x, v) (HW_CMT_DMA(x).U = (v))
1056 #define HW_CMT_DMA_SET(x, v) (HW_CMT_DMA_WR(x, HW_CMT_DMA_RD(x) | (v)))
1057 #define HW_CMT_DMA_CLR(x, v) (HW_CMT_DMA_WR(x, HW_CMT_DMA_RD(x) & ~(v)))
1058 #define HW_CMT_DMA_TOG(x, v) (HW_CMT_DMA_WR(x, HW_CMT_DMA_RD(x) ^ (v)))
1062 * Constants & macros for individual CMT_DMA bitfields
1066 * @name Register CMT_DMA, field DMA[0] (RW)
1068 * Enables the DMA protocol.
1071 * - 0 - DMA transfer request and done are disabled.
1072 * - 1 - DMA transfer request and done are enabled.
1075 #define BP_CMT_DMA_DMA (0U) /*!< Bit position for CMT_DMA_DMA. */
1076 #define BM_CMT_DMA_DMA (0x01U) /*!< Bit mask for CMT_DMA_DMA. */
1077 #define BS_CMT_DMA_DMA (1U) /*!< Bit field size in bits for CMT_DMA_DMA. */
1079 /*! @brief Read current value of the CMT_DMA_DMA field. */
1080 #define BR_CMT_DMA_DMA(x) (BITBAND_ACCESS8(HW_CMT_DMA_ADDR(x), BP_CMT_DMA_DMA))
1082 /*! @brief Format value for bitfield CMT_DMA_DMA. */
1083 #define BF_CMT_DMA_DMA(v) ((uint8_t)((uint8_t)(v) << BP_CMT_DMA_DMA) & BM_CMT_DMA_DMA)
1085 /*! @brief Set the DMA field to a new value. */
1086 #define BW_CMT_DMA_DMA(x, v) (BITBAND_ACCESS8(HW_CMT_DMA_ADDR(x), BP_CMT_DMA_DMA) = (v))
1089 /*******************************************************************************
1090 * hw_cmt_t - module struct
1091 ******************************************************************************/
1093 * @brief All CMT module registers.
1096 typedef struct _hw_cmt
1098 __IO hw_cmt_cgh1_t CGH1; /*!< [0x0] CMT Carrier Generator High Data Register 1 */
1099 __IO hw_cmt_cgl1_t CGL1; /*!< [0x1] CMT Carrier Generator Low Data Register 1 */
1100 __IO hw_cmt_cgh2_t CGH2; /*!< [0x2] CMT Carrier Generator High Data Register 2 */
1101 __IO hw_cmt_cgl2_t CGL2; /*!< [0x3] CMT Carrier Generator Low Data Register 2 */
1102 __IO hw_cmt_oc_t OC; /*!< [0x4] CMT Output Control Register */
1103 __IO hw_cmt_msc_t MSC; /*!< [0x5] CMT Modulator Status and Control Register */
1104 __IO hw_cmt_cmd1_t CMD1; /*!< [0x6] CMT Modulator Data Register Mark High */
1105 __IO hw_cmt_cmd2_t CMD2; /*!< [0x7] CMT Modulator Data Register Mark Low */
1106 __IO hw_cmt_cmd3_t CMD3; /*!< [0x8] CMT Modulator Data Register Space High */
1107 __IO hw_cmt_cmd4_t CMD4; /*!< [0x9] CMT Modulator Data Register Space Low */
1108 __IO hw_cmt_pps_t PPS; /*!< [0xA] CMT Primary Prescaler Register */
1109 __IO hw_cmt_dma_t DMA; /*!< [0xB] CMT Direct Memory Access Register */
1113 /*! @brief Macro to access all CMT registers. */
1114 /*! @param x CMT module instance base address. */
1115 /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
1116 * use the '&' operator, like <code>&HW_CMT(CMT_BASE)</code>. */
1117 #define HW_CMT(x) (*(hw_cmt_t *)(x))
1119 #endif /* __HW_CMT_REGISTERS_H__ */