aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114')
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/LPC54114_cm0plus.h12087
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/LPC54114_cm0plus_features.h255
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/LPC54114_cm4.h12100
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/LPC54114_cm4_features.h255
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/all_lib_device_LPC54114_cm0plus.cmake41
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/all_lib_device_LPC54114_cm4.cmake110
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/arm/LPC5411x_256.FLMbin0 -> 12804 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/arm/LPC541xx.dbgconf23
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/device_CMSIS.cmake21
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/device_CMSIS_LPC54114_cm0plus.cmake18
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/device_CMSIS_LPC54114_cm4.cmake18
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/device_startup_LPC54114_cm0plus.cmake15
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/device_startup_LPC54114_cm4.cmake15
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/device_system_LPC54114_cm0plus.cmake16
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/device_system_LPC54114_cm4.cmake16
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/driver_power.cmake16
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/drivers/driver_clock.cmake23
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/drivers/driver_inputmux_connections.cmake15
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/drivers/driver_reset.cmake16
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/drivers/fsl_clock.c1777
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/drivers/fsl_clock.h876
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/drivers/fsl_fro_calib.h39
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/drivers/fsl_inputmux_connections.h157
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/drivers/fsl_power.c20
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/drivers/fsl_power.h235
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/drivers/fsl_reset.c185
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/drivers/fsl_reset.h205
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/fsl_device_registers.h43
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/gcc/LPC54114J256_cm0plus_flash.ld209
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/gcc/LPC54114J256_cm0plus_ram.ld208
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/gcc/LPC54114J256_cm4_flash.ld225
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/gcc/LPC54114J256_cm4_ram.ld199
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/gcc/libfro_calib_cm0.abin0 -> 2664 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/gcc/libfro_calib_cm4_hardabi.abin0 -> 2608 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/gcc/libfro_calib_cm4_softabi.abin0 -> 2604 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/gcc/libpower_cm0.abin0 -> 24252 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/gcc/libpower_cm4_hardabi.abin0 -> 23772 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/gcc/libpower_cm4_softabi.abin0 -> 23772 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/gcc/startup_LPC54114_cm0plus.S617
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/gcc/startup_LPC54114_cm4.S753
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/mcuxpresso/boot_multicore_slave.c128
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/mcuxpresso/boot_multicore_slave.h46
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/mcuxpresso/libfro_calib_cm0.abin0 -> 2664 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/mcuxpresso/libfro_calib_cm4_hardabi.abin0 -> 2608 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/mcuxpresso/libfro_calib_cm4_softabi.abin0 -> 2604 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/mcuxpresso/libpower_cm0.abin0 -> 24252 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/mcuxpresso/libpower_cm4_hardabi.abin0 -> 23772 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/mcuxpresso/libpower_cm4_softabi.abin0 -> 23772 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/mcuxpresso/startup_lpc5411x.c772
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/mcuxpresso/startup_lpc5411x.cpp772
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/project_template/board.c86
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/project_template/board.h121
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/project_template/clock_config.c98
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/project_template/clock_config.h69
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/project_template/peripherals.c51
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/project_template/peripherals.h34
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/project_template/pin_mux.c61
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/project_template/pin_mux.h52
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/system_LPC54114_cm0plus.c347
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/system_LPC54114_cm0plus.h109
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/system_LPC54114_cm4.c355
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/system_LPC54114_cm4.h109
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/template/RTE_Device.h231
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/utilities/fsl_notifier.c209
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/utilities/fsl_notifier.h237
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/utilities/fsl_shell.c1085
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/utilities/fsl_shell.h292
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/utilities/utility_shell.cmake18
68 files changed, 36090 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/LPC54114_cm0plus.h b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/LPC54114_cm0plus.h
new file mode 100644
index 000000000..bb275a144
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54114/LPC54114_cm0plus.h
@@ -0,0 +1,12087 @@
1/*
2** ###################################################################
3** Processors: LPC54114J256BD64_cm0plus
4** LPC54114J256UK49_cm0plus
5**
6** Compilers: GNU C Compiler
7** IAR ANSI C/C++ Compiler for ARM
8** Keil ARM C/C++ Compiler
9** MCUXpresso Compiler
10**
11** Reference manual: LPC5411x User manual Rev. 1.1 25 May 2016
12** Version: rev. 1.0, 2016-04-29
13** Build: b200304
14**
15** Abstract:
16** CMSIS Peripheral Access Layer for LPC54114_cm0plus
17**
18** Copyright 1997-2016 Freescale Semiconductor, Inc.
19** Copyright 2016-2020 NXP
20** All rights reserved.
21**
22** SPDX-License-Identifier: BSD-3-Clause
23**
24** http: www.nxp.com
25** mail: [email protected]
26**
27** Revisions:
28** - rev. 1.0 (2016-04-29)
29** Initial version.
30**
31** ###################################################################
32*/
33
34/*!
35 * @file LPC54114_cm0plus.h
36 * @version 1.0
37 * @date 2016-04-29
38 * @brief CMSIS Peripheral Access Layer for LPC54114_cm0plus
39 *
40 * CMSIS Peripheral Access Layer for LPC54114_cm0plus
41 */
42
43#ifndef _LPC54114_CM0PLUS_H_
44#define _LPC54114_CM0PLUS_H_ /**< Symbol preventing repeated inclusion */
45
46/** Memory map major version (memory maps with equal major version number are
47 * compatible) */
48#define MCU_MEM_MAP_VERSION 0x0100U
49/** Memory map minor version */
50#define MCU_MEM_MAP_VERSION_MINOR 0x0000U
51
52
53/* ----------------------------------------------------------------------------
54 -- Interrupt vector numbers
55 ---------------------------------------------------------------------------- */
56
57/*!
58 * @addtogroup Interrupt_vector_numbers Interrupt vector numbers
59 * @{
60 */
61
62/** Interrupt Number Definitions */
63#define NUMBER_OF_INT_VECTORS 48 /**< Number of interrupts in the Vector table */
64
65typedef enum IRQn {
66 /* Auxiliary constants */
67 NotAvail_IRQn = -128, /**< Not available device specific interrupt */
68
69 /* Core interrupts */
70 NonMaskableInt_IRQn = -14, /**< Non Maskable Interrupt */
71 HardFault_IRQn = -13, /**< Cortex-M0 SV Hard Fault Interrupt */
72 SVCall_IRQn = -5, /**< Cortex-M0 SV Call Interrupt */
73 PendSV_IRQn = -2, /**< Cortex-M0 Pend SV Interrupt */
74 SysTick_IRQn = -1, /**< Cortex-M0 System Tick Interrupt */
75
76 /* Device specific interrupts */
77 WDT_BOD_IRQn = 0, /**< Windowed watchdog timer, Brownout detect */
78 DMA0_IRQn = 1, /**< DMA controller */
79 GINT0_IRQn = 2, /**< GPIO group 0 */
80 GINT1_IRQn = 3, /**< GPIO group 1 */
81 PIN_INT0_IRQn = 4, /**< Pin interrupt 0 or pattern match engine slice 0 */
82 PIN_INT1_IRQn = 5, /**< Pin interrupt 1or pattern match engine slice 1 */
83 PIN_INT2_IRQn = 6, /**< Pin interrupt 2 or pattern match engine slice 2 */
84 PIN_INT3_IRQn = 7, /**< Pin interrupt 3 or pattern match engine slice 3 */
85 UTICK0_IRQn = 8, /**< Micro-tick Timer */
86 MRT0_IRQn = 9, /**< Multi-rate timer */
87 CTIMER0_IRQn = 10, /**< Standard counter/timer CTIMER0 */
88 CTIMER1_IRQn = 11, /**< Standard counter/timer CTIMER1 */
89 SCT0_IRQn = 12, /**< SCTimer/PWM */
90 CTIMER3_IRQn = 13, /**< Standard counter/timer CTIMER3 */
91 FLEXCOMM0_IRQn = 14, /**< Flexcomm Interface 0 (USART, SPI, I2C) */
92 FLEXCOMM1_IRQn = 15, /**< Flexcomm Interface 1 (USART, SPI, I2C) */
93 FLEXCOMM2_IRQn = 16, /**< Flexcomm Interface 2 (USART, SPI, I2C) */
94 FLEXCOMM3_IRQn = 17, /**< Flexcomm Interface 3 (USART, SPI, I2C) */
95 FLEXCOMM4_IRQn = 18, /**< Flexcomm Interface 4 (USART, SPI, I2C) */
96 FLEXCOMM5_IRQn = 19, /**< Flexcomm Interface 5 (USART, SPI, I2C) */
97 FLEXCOMM6_IRQn = 20, /**< Flexcomm Interface 6 (USART, SPI, I2C, I2S) */
98 FLEXCOMM7_IRQn = 21, /**< Flexcomm Interface 7 (USART, SPI, I2C, I2S) */
99 ADC0_SEQA_IRQn = 22, /**< ADC0 sequence A completion. */
100 ADC0_SEQB_IRQn = 23, /**< ADC0 sequence B completion. */
101 ADC0_THCMP_IRQn = 24, /**< ADC0 threshold compare and error. */
102 DMIC0_IRQn = 25, /**< Digital microphone and DMIC subsystem */
103 HWVAD0_IRQn = 26, /**< Hardware Voice Activity Detector */
104 USB0_NEEDCLK_IRQn = 27, /**< USB Activity Wake-up Interrupt */
105 USB0_IRQn = 28, /**< USB device */
106 RTC_IRQn = 29, /**< RTC alarm and wake-up interrupts */
107 IOH_IRQn = 30, /**< IOH */
108 MAILBOX_IRQn = 31 /**< Mailbox interrupt (present on selected devices) */
109} IRQn_Type;
110
111/*!
112 * @}
113 */ /* end of group Interrupt_vector_numbers */
114
115
116/* ----------------------------------------------------------------------------
117 -- Cortex M0 Core Configuration
118 ---------------------------------------------------------------------------- */
119
120/*!
121 * @addtogroup Cortex_Core_Configuration Cortex M0 Core Configuration
122 * @{
123 */
124
125#define __CM0PLUS_REV 0x0000 /**< Core revision r0p0 */
126#define __MPU_PRESENT 0 /**< Defines if an MPU is present or not */
127#define __VTOR_PRESENT 1 /**< Defines if VTOR is present or not */
128#define __NVIC_PRIO_BITS 2 /**< Number of priority bits implemented in the NVIC */
129#define __Vendor_SysTickConfig 0 /**< Vendor specific implementation of SysTickConfig is defined */
130
131#include "core_cm0plus.h" /* Core Peripheral Access Layer */
132#include "system_LPC54114_cm0plus.h" /* Device specific configuration file */
133
134/*!
135 * @}
136 */ /* end of group Cortex_Core_Configuration */
137
138
139/* ----------------------------------------------------------------------------
140 -- Device Peripheral Access Layer
141 ---------------------------------------------------------------------------- */
142
143/*!
144 * @addtogroup Peripheral_access_layer Device Peripheral Access Layer
145 * @{
146 */
147
148
149/*
150** Start of section using anonymous unions
151*/
152
153#if defined(__ARMCC_VERSION)
154 #if (__ARMCC_VERSION >= 6010050)
155 #pragma clang diagnostic push
156 #else
157 #pragma push
158 #pragma anon_unions
159 #endif
160#elif defined(__GNUC__)
161 /* anonymous unions are enabled by default */
162#elif defined(__IAR_SYSTEMS_ICC__)
163 #pragma language=extended
164#else
165 #error Not supported compiler type
166#endif
167
168/* ----------------------------------------------------------------------------
169 -- ADC Peripheral Access Layer
170 ---------------------------------------------------------------------------- */
171
172/*!
173 * @addtogroup ADC_Peripheral_Access_Layer ADC Peripheral Access Layer
174 * @{
175 */
176
177/** ADC - Register Layout Typedef */
178typedef struct {
179 __IO uint32_t CTRL; /**< ADC Control register. Contains the clock divide value, resolution selection, sampling time selection, and mode controls., offset: 0x0 */
180 __IO uint32_t INSEL; /**< Input Select. Allows selection of the temperature sensor as an alternate input to ADC channel 0., offset: 0x4 */
181 __IO uint32_t SEQ_CTRL[2]; /**< ADC Conversion Sequence-n control register: Controls triggering and channel selection for conversion sequence-n. Also specifies interrupt mode for sequence-n., array offset: 0x8, array step: 0x4 */
182 __I uint32_t SEQ_GDAT[2]; /**< ADC Sequence-n Global Data register. This register contains the result of the most recent ADC conversion performed under sequence-n., array offset: 0x10, array step: 0x4 */
183 uint8_t RESERVED_0[8];
184 __I uint32_t DAT[12]; /**< ADC Channel 0 Data register. This register contains the result of the most recent conversion completed on channel 0., array offset: 0x20, array step: 0x4 */
185 __IO uint32_t THR0_LOW; /**< ADC Low Compare Threshold register 0: Contains the lower threshold level for automatic threshold comparison for any channels linked to threshold pair 0., offset: 0x50 */
186 __IO uint32_t THR1_LOW; /**< ADC Low Compare Threshold register 1: Contains the lower threshold level for automatic threshold comparison for any channels linked to threshold pair 1., offset: 0x54 */
187 __IO uint32_t THR0_HIGH; /**< ADC High Compare Threshold register 0: Contains the upper threshold level for automatic threshold comparison for any channels linked to threshold pair 0., offset: 0x58 */
188 __IO uint32_t THR1_HIGH; /**< ADC High Compare Threshold register 1: Contains the upper threshold level for automatic threshold comparison for any channels linked to threshold pair 1., offset: 0x5C */
189 __IO uint32_t CHAN_THRSEL; /**< ADC Channel-Threshold Select register. Specifies which set of threshold compare registers are to be used for each channel, offset: 0x60 */
190 __IO uint32_t INTEN; /**< ADC Interrupt Enable register. This register contains enable bits that enable the sequence-A, sequence-B, threshold compare and data overrun interrupts to be generated., offset: 0x64 */
191 __IO uint32_t FLAGS; /**< ADC Flags register. Contains the four interrupt/DMA trigger flags and the individual component overrun and threshold-compare flags. (The overrun bits replicate information stored in the result registers)., offset: 0x68 */
192 __IO uint32_t STARTUP; /**< ADC Startup register., offset: 0x6C */
193 __IO uint32_t CALIB; /**< ADC Calibration register., offset: 0x70 */
194} ADC_Type;
195
196/* ----------------------------------------------------------------------------
197 -- ADC Register Masks
198 ---------------------------------------------------------------------------- */
199
200/*!
201 * @addtogroup ADC_Register_Masks ADC Register Masks
202 * @{
203 */
204
205/*! @name CTRL - ADC Control register. Contains the clock divide value, resolution selection, sampling time selection, and mode controls. */
206/*! @{ */
207#define ADC_CTRL_CLKDIV_MASK (0xFFU)
208#define ADC_CTRL_CLKDIV_SHIFT (0U)
209/*! CLKDIV - In synchronous mode only, the system clock is divided by this value plus one to produce
210 * the clock for the ADC converter, which should be less than or equal to 72 MHz. Typically,
211 * software should program the smallest value in this field that yields this maximum clock rate or
212 * slightly less, but in certain cases (such as a high-impedance analog source) a slower clock may
213 * be desirable. This field is ignored in the asynchronous operating mode.
214 */
215#define ADC_CTRL_CLKDIV(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CLKDIV_SHIFT)) & ADC_CTRL_CLKDIV_MASK)
216#define ADC_CTRL_ASYNMODE_MASK (0x100U)
217#define ADC_CTRL_ASYNMODE_SHIFT (8U)
218/*! ASYNMODE - Select clock mode.
219 * 0b0..Synchronous mode. The ADC clock is derived from the system clock based on the divide value selected in
220 * the CLKDIV field. The ADC clock will be started in a controlled fashion in response to a trigger to
221 * eliminate any uncertainty in the launching of an ADC conversion in response to any synchronous (on-chip) trigger.
222 * In Synchronous mode with the SYNCBYPASS bit (in a sequence control register) set, sampling of the ADC
223 * input and start of conversion will initiate 2 system clocks after the leading edge of a (synchronous) trigger
224 * pulse.
225 * 0b1..Asynchronous mode. The ADC clock is based on the output of the ADC clock divider ADCCLKSEL in the SYSCON block.
226 */
227#define ADC_CTRL_ASYNMODE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_ASYNMODE_SHIFT)) & ADC_CTRL_ASYNMODE_MASK)
228#define ADC_CTRL_RESOL_MASK (0x600U)
229#define ADC_CTRL_RESOL_SHIFT (9U)
230/*! RESOL - The number of bits of ADC resolution. Accuracy can be reduced to achieve higher
231 * conversion rates. A single conversion (including one conversion in a burst or sequence) requires the
232 * selected number of bits of resolution plus 3 ADC clocks. This field must only be altered when
233 * the ADC is fully idle. Changing it during any kind of ADC operation may have unpredictable
234 * results. ADC clock frequencies for various resolutions must not exceed: - 5x the system clock rate
235 * for 12-bit resolution - 4.3x the system clock rate for 10-bit resolution - 3.6x the system
236 * clock for 8-bit resolution - 3x the bus clock rate for 6-bit resolution
237 * 0b00..6-bit resolution. An ADC conversion requires 9 ADC clocks, plus any clocks specified by the TSAMP field.
238 * 0b01..8-bit resolution. An ADC conversion requires 11 ADC clocks, plus any clocks specified by the TSAMP field.
239 * 0b10..10-bit resolution. An ADC conversion requires 13 ADC clocks, plus any clocks specified by the TSAMP field.
240 * 0b11..12-bit resolution. An ADC conversion requires 15 ADC clocks, plus any clocks specified by the TSAMP field.
241 */
242#define ADC_CTRL_RESOL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RESOL_SHIFT)) & ADC_CTRL_RESOL_MASK)
243#define ADC_CTRL_BYPASSCAL_MASK (0x800U)
244#define ADC_CTRL_BYPASSCAL_SHIFT (11U)
245/*! BYPASSCAL - Bypass Calibration. This bit may be set to avoid the need to calibrate if offset
246 * error is not a concern in the application.
247 * 0b0..Calibrate. The stored calibration value will be applied to the ADC during conversions to compensated for
248 * offset error. A calibration cycle must be performed each time the chip is powered-up. Re-calibration may
249 * be warranted periodically - especially if operating conditions have changed.
250 * 0b1..Bypass calibration. Calibration is not utilized. Less time is required when enabling the ADC -
251 * particularly following chip power-up. Attempts to launch a calibration cycle are blocked when this bit is set.
252 */
253#define ADC_CTRL_BYPASSCAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_BYPASSCAL_SHIFT)) & ADC_CTRL_BYPASSCAL_MASK)
254#define ADC_CTRL_TSAMP_MASK (0x7000U)
255#define ADC_CTRL_TSAMP_SHIFT (12U)
256/*! TSAMP - Sample Time. The default sampling period (TSAMP = '000') at the start of each conversion
257 * is 2.5 ADC clock periods. Depending on a variety of factors, including operating conditions
258 * and the output impedance of the analog source, longer sampling times may be required. See
259 * Section 28.7.10. The TSAMP field specifies the number of additional ADC clock cycles, from zero to
260 * seven, by which the sample period will be extended. The total conversion time will increase by
261 * the same number of clocks. 000 - The sample period will be the default 2.5 ADC clocks. A
262 * complete conversion with 12-bits of accuracy will require 15 clocks. 001- The sample period will
263 * be extended by one ADC clock to a total of 3.5 clock periods. A complete 12-bit conversion will
264 * require 16 clocks. 010 - The sample period will be extended by two clocks to 4.5 ADC clock
265 * cycles. A complete 12-bit conversion will require 17 ADC clocks. 111 - The sample period will be
266 * extended by seven clocks to 9.5 ADC clock cycles. A complete 12-bit conversion will require
267 * 22 ADC clocks.
268 */
269#define ADC_CTRL_TSAMP(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_TSAMP_SHIFT)) & ADC_CTRL_TSAMP_MASK)
270/*! @} */
271
272/*! @name INSEL - Input Select. Allows selection of the temperature sensor as an alternate input to ADC channel 0. */
273/*! @{ */
274#define ADC_INSEL_SEL_MASK (0x3U)
275#define ADC_INSEL_SEL_SHIFT (0U)
276/*! SEL - Selects the input source for channel 0. All other values are reserved.
277 * 0b00..ADC0_IN0 function.
278 * 0b11..Internal temperature sensor.
279 */
280#define ADC_INSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_INSEL_SEL_SHIFT)) & ADC_INSEL_SEL_MASK)
281/*! @} */
282
283/*! @name SEQ_CTRL - ADC Conversion Sequence-n control register: Controls triggering and channel selection for conversion sequence-n. Also specifies interrupt mode for sequence-n. */
284/*! @{ */
285#define ADC_SEQ_CTRL_CHANNELS_MASK (0xFFFU)
286#define ADC_SEQ_CTRL_CHANNELS_SHIFT (0U)
287/*! CHANNELS - Selects which one or more of the ADC channels will be sampled and converted when this
288 * sequence is launched. A 1 in any bit of this field will cause the corresponding channel to be
289 * included in the conversion sequence, where bit 0 corresponds to channel 0, bit 1 to channel 1
290 * and so forth. When this conversion sequence is triggered, either by a hardware trigger or via
291 * software command, ADC conversions will be performed on each enabled channel, in sequence,
292 * beginning with the lowest-ordered channel. This field can ONLY be changed while SEQA_ENA (bit 31)
293 * is LOW. It is allowed to change this field and set bit 31 in the same write.
294 */
295#define ADC_SEQ_CTRL_CHANNELS(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_CHANNELS_SHIFT)) & ADC_SEQ_CTRL_CHANNELS_MASK)
296#define ADC_SEQ_CTRL_TRIGGER_MASK (0x3F000U)
297#define ADC_SEQ_CTRL_TRIGGER_SHIFT (12U)
298/*! TRIGGER - Selects which of the available hardware trigger sources will cause this conversion
299 * sequence to be initiated. Program the trigger input number in this field. See Table 476. In order
300 * to avoid generating a spurious trigger, it is recommended writing to this field only when
301 * SEQA_ENA (bit 31) is low. It is safe to change this field and set bit 31 in the same write.
302 */
303#define ADC_SEQ_CTRL_TRIGGER(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_TRIGGER_SHIFT)) & ADC_SEQ_CTRL_TRIGGER_MASK)
304#define ADC_SEQ_CTRL_TRIGPOL_MASK (0x40000U)
305#define ADC_SEQ_CTRL_TRIGPOL_SHIFT (18U)
306/*! TRIGPOL - Select the polarity of the selected input trigger for this conversion sequence. In
307 * order to avoid generating a spurious trigger, it is recommended writing to this field only when
308 * SEQA_ENA (bit 31) is low. It is safe to change this field and set bit 31 in the same write.
309 * 0b0..Negative edge. A negative edge launches the conversion sequence on the selected trigger input.
310 * 0b1..Positive edge. A positive edge launches the conversion sequence on the selected trigger input.
311 */
312#define ADC_SEQ_CTRL_TRIGPOL(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_TRIGPOL_SHIFT)) & ADC_SEQ_CTRL_TRIGPOL_MASK)
313#define ADC_SEQ_CTRL_SYNCBYPASS_MASK (0x80000U)
314#define ADC_SEQ_CTRL_SYNCBYPASS_SHIFT (19U)
315/*! SYNCBYPASS - Setting this bit allows the hardware trigger input to bypass synchronization
316 * flip-flop stages and therefore shorten the time between the trigger input signal and the start of a
317 * conversion. There are slightly different criteria for whether or not this bit can be set
318 * depending on the clock operating mode: Synchronous mode (the ASYNMODE in the CTRL register = 0):
319 * Synchronization may be bypassed (this bit may be set) if the selected trigger source is already
320 * synchronous with the main system clock (eg. coming from an on-chip, system-clock-based timer).
321 * Whether this bit is set or not, a trigger pulse must be maintained for at least one system
322 * clock period. Asynchronous mode (the ASYNMODE in the CTRL register = 1): Synchronization may be
323 * bypassed (this bit may be set) if it is certain that the duration of a trigger input pulse
324 * will be at least one cycle of the ADC clock (regardless of whether the trigger comes from and
325 * on-chip or off-chip source). If this bit is NOT set, the trigger pulse must at least be
326 * maintained for one system clock period.
327 * 0b0..Enable trigger synchronization. The hardware trigger bypass is not enabled.
328 * 0b1..Bypass trigger synchronization. The hardware trigger bypass is enabled.
329 */
330#define ADC_SEQ_CTRL_SYNCBYPASS(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_SYNCBYPASS_SHIFT)) & ADC_SEQ_CTRL_SYNCBYPASS_MASK)
331#define ADC_SEQ_CTRL_START_MASK (0x4000000U)
332#define ADC_SEQ_CTRL_START_SHIFT (26U)
333/*! START - Writing a 1 to this field will launch one pass through this conversion sequence. The
334 * behavior will be identical to a sequence triggered by a hardware trigger. Do not write 1 to this
335 * bit if the BURST bit is set. This bit is only set to a 1 momentarily when written to launch a
336 * conversion sequence. It will consequently always read back as a zero.
337 */
338#define ADC_SEQ_CTRL_START(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_START_SHIFT)) & ADC_SEQ_CTRL_START_MASK)
339#define ADC_SEQ_CTRL_BURST_MASK (0x8000000U)
340#define ADC_SEQ_CTRL_BURST_SHIFT (27U)
341/*! BURST - Writing a 1 to this bit will cause this conversion sequence to be continuously cycled
342 * through. Other sequence A triggers will be ignored while this bit is set. Repeated conversions
343 * can be halted by clearing this bit. The sequence currently in progress will be completed before
344 * conversions are terminated. Note that a new sequence could begin just before BURST is cleared.
345 */
346#define ADC_SEQ_CTRL_BURST(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_BURST_SHIFT)) & ADC_SEQ_CTRL_BURST_MASK)
347#define ADC_SEQ_CTRL_SINGLESTEP_MASK (0x10000000U)
348#define ADC_SEQ_CTRL_SINGLESTEP_SHIFT (28U)
349/*! SINGLESTEP - When this bit is set, a hardware trigger or a write to the START bit will launch a
350 * single conversion on the next channel in the sequence instead of the default response of
351 * launching an entire sequence of conversions. Once all of the channels comprising a sequence have
352 * been converted, a subsequent trigger will repeat the sequence beginning with the first enabled
353 * channel. Interrupt generation will still occur either after each individual conversion or at
354 * the end of the entire sequence, depending on the state of the MODE bit.
355 */
356#define ADC_SEQ_CTRL_SINGLESTEP(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_SINGLESTEP_SHIFT)) & ADC_SEQ_CTRL_SINGLESTEP_MASK)
357#define ADC_SEQ_CTRL_LOWPRIO_MASK (0x20000000U)
358#define ADC_SEQ_CTRL_LOWPRIO_SHIFT (29U)
359/*! LOWPRIO - Set priority for sequence A.
360 * 0b0..Low priority. Any B trigger which occurs while an A conversion sequence is active will be ignored and lost.
361 * 0b1..High priority. Setting this bit to a 1 will permit any enabled B sequence trigger (including a B sequence
362 * software start) to immediately interrupt sequence A and launch a B sequence in it's place. The conversion
363 * currently in progress will be terminated. The A sequence that was interrupted will automatically resume
364 * after the B sequence completes. The channel whose conversion was terminated will be re-sampled and the
365 * conversion sequence will resume from that point.
366 */
367#define ADC_SEQ_CTRL_LOWPRIO(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_LOWPRIO_SHIFT)) & ADC_SEQ_CTRL_LOWPRIO_MASK)
368#define ADC_SEQ_CTRL_MODE_MASK (0x40000000U)
369#define ADC_SEQ_CTRL_MODE_SHIFT (30U)
370/*! MODE - Indicates whether the primary method for retrieving conversion results for this sequence
371 * will be accomplished via reading the global data register (SEQA_GDAT) at the end of each
372 * conversion, or the individual channel result registers at the end of the entire sequence. Impacts
373 * when conversion-complete interrupt/DMA trigger for sequence-A will be generated and which
374 * overrun conditions contribute to an overrun interrupt as described below.
375 * 0b0..End of conversion. The sequence A interrupt/DMA trigger will be set at the end of each individual ADC
376 * conversion performed under sequence A. This flag will mirror the DATAVALID bit in the SEQA_GDAT register. The
377 * OVERRUN bit in the SEQA_GDAT register will contribute to generation of an overrun interrupt/DMA trigger
378 * if enabled.
379 * 0b1..End of sequence. The sequence A interrupt/DMA trigger will be set when the entire set of sequence-A
380 * conversions completes. This flag will need to be explicitly cleared by software or by the DMA-clear signal in
381 * this mode. The OVERRUN bit in the SEQA_GDAT register will NOT contribute to generation of an overrun
382 * interrupt/DMA trigger since it is assumed this register may not be utilized in this mode.
383 */
384#define ADC_SEQ_CTRL_MODE(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_MODE_SHIFT)) & ADC_SEQ_CTRL_MODE_MASK)
385#define ADC_SEQ_CTRL_SEQ_ENA_MASK (0x80000000U)
386#define ADC_SEQ_CTRL_SEQ_ENA_SHIFT (31U)
387/*! SEQ_ENA - Sequence Enable. In order to avoid spuriously triggering the sequence, care should be
388 * taken to only set the SEQn_ENA bit when the selected trigger input is in its INACTIVE state
389 * (as defined by the TRIGPOL bit). If this condition is not met, the sequence will be triggered
390 * immediately upon being enabled. In order to avoid spuriously triggering the sequence, care
391 * should be taken to only set the SEQn_ENA bit when the selected trigger input is in its INACTIVE
392 * state (as defined by the TRIGPOL bit). If this condition is not met, the sequence will be
393 * triggered immediately upon being enabled.
394 * 0b0..Disabled. Sequence n is disabled. Sequence n triggers are ignored. If this bit is cleared while sequence
395 * n is in progress, the sequence will be halted at the end of the current conversion. After the sequence is
396 * re-enabled, a new trigger will be required to restart the sequence beginning with the next enabled channel.
397 * 0b1..Enabled. Sequence n is enabled.
398 */
399#define ADC_SEQ_CTRL_SEQ_ENA(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_SEQ_ENA_SHIFT)) & ADC_SEQ_CTRL_SEQ_ENA_MASK)
400/*! @} */
401
402/* The count of ADC_SEQ_CTRL */
403#define ADC_SEQ_CTRL_COUNT (2U)
404
405/*! @name SEQ_GDAT - ADC Sequence-n Global Data register. This register contains the result of the most recent ADC conversion performed under sequence-n. */
406/*! @{ */
407#define ADC_SEQ_GDAT_RESULT_MASK (0xFFF0U)
408#define ADC_SEQ_GDAT_RESULT_SHIFT (4U)
409/*! RESULT - This field contains the 12-bit ADC conversion result from the most recent conversion
410 * performed under conversion sequence associated with this register. The result is a binary
411 * fraction representing the voltage on the currently-selected input channel as it falls within the
412 * range of VREFP to VREFN. Zero in the field indicates that the voltage on the input pin was less
413 * than, equal to, or close to that on VREFN, while 0xFFF indicates that the voltage on the input
414 * was close to, equal to, or greater than that on VREFP. DATAVALID = 1 indicates that this
415 * result has not yet been read.
416 */
417#define ADC_SEQ_GDAT_RESULT(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_GDAT_RESULT_SHIFT)) & ADC_SEQ_GDAT_RESULT_MASK)
418#define ADC_SEQ_GDAT_THCMPRANGE_MASK (0x30000U)
419#define ADC_SEQ_GDAT_THCMPRANGE_SHIFT (16U)
420/*! THCMPRANGE - Indicates whether the result of the last conversion performed was above, below or
421 * within the range established by the designated threshold comparison registers (THRn_LOW and
422 * THRn_HIGH).
423 */
424#define ADC_SEQ_GDAT_THCMPRANGE(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_GDAT_THCMPRANGE_SHIFT)) & ADC_SEQ_GDAT_THCMPRANGE_MASK)
425#define ADC_SEQ_GDAT_THCMPCROSS_MASK (0xC0000U)
426#define ADC_SEQ_GDAT_THCMPCROSS_SHIFT (18U)
427/*! THCMPCROSS - Indicates whether the result of the last conversion performed represented a
428 * crossing of the threshold level established by the designated LOW threshold comparison register
429 * (THRn_LOW) and, if so, in what direction the crossing occurred.
430 */
431#define ADC_SEQ_GDAT_THCMPCROSS(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_GDAT_THCMPCROSS_SHIFT)) & ADC_SEQ_GDAT_THCMPCROSS_MASK)
432#define ADC_SEQ_GDAT_CHN_MASK (0x3C000000U)
433#define ADC_SEQ_GDAT_CHN_SHIFT (26U)
434/*! CHN - These bits contain the channel from which the RESULT bits were converted (e.g. 0000
435 * identifies channel 0, 0001 channel 1, etc.).
436 */
437#define ADC_SEQ_GDAT_CHN(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_GDAT_CHN_SHIFT)) & ADC_SEQ_GDAT_CHN_MASK)
438#define ADC_SEQ_GDAT_OVERRUN_MASK (0x40000000U)
439#define ADC_SEQ_GDAT_OVERRUN_SHIFT (30U)
440/*! OVERRUN - This bit is set if a new conversion result is loaded into the RESULT field before a
441 * previous result has been read - i.e. while the DATAVALID bit is set. This bit is cleared, along
442 * with the DATAVALID bit, whenever this register is read. This bit will contribute to an overrun
443 * interrupt/DMA trigger if the MODE bit (in SEQAA_CTRL) for the corresponding sequence is set
444 * to '0' (and if the overrun interrupt is enabled).
445 */
446#define ADC_SEQ_GDAT_OVERRUN(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_GDAT_OVERRUN_SHIFT)) & ADC_SEQ_GDAT_OVERRUN_MASK)
447#define ADC_SEQ_GDAT_DATAVALID_MASK (0x80000000U)
448#define ADC_SEQ_GDAT_DATAVALID_SHIFT (31U)
449/*! DATAVALID - This bit is set to '1' at the end of each conversion when a new result is loaded
450 * into the RESULT field. It is cleared whenever this register is read. This bit will cause a
451 * conversion-complete interrupt for the corresponding sequence if the MODE bit (in SEQA_CTRL) for that
452 * sequence is set to 0 (and if the interrupt is enabled).
453 */
454#define ADC_SEQ_GDAT_DATAVALID(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_GDAT_DATAVALID_SHIFT)) & ADC_SEQ_GDAT_DATAVALID_MASK)
455/*! @} */
456
457/* The count of ADC_SEQ_GDAT */
458#define ADC_SEQ_GDAT_COUNT (2U)
459
460/*! @name DAT - ADC Channel 0 Data register. This register contains the result of the most recent conversion completed on channel 0. */
461/*! @{ */
462#define ADC_DAT_RESULT_MASK (0xFFF0U)
463#define ADC_DAT_RESULT_SHIFT (4U)
464/*! RESULT - This field contains the 12-bit ADC conversion result from the last conversion performed
465 * on this channel. This will be a binary fraction representing the voltage on the AD0[n] pin,
466 * as it falls within the range of VREFP to VREFN. Zero in the field indicates that the voltage on
467 * the input pin was less than, equal to, or close to that on VREFN, while 0xFFF indicates that
468 * the voltage on the input was close to, equal to, or greater than that on VREFP.
469 */
470#define ADC_DAT_RESULT(x) (((uint32_t)(((uint32_t)(x)) << ADC_DAT_RESULT_SHIFT)) & ADC_DAT_RESULT_MASK)
471#define ADC_DAT_THCMPRANGE_MASK (0x30000U)
472#define ADC_DAT_THCMPRANGE_SHIFT (16U)
473/*! THCMPRANGE - Threshold Range Comparison result. 0x0 = In Range: The last completed conversion
474 * was greater than or equal to the value programmed into the designated LOW threshold register
475 * (THRn_LOW) but less than or equal to the value programmed into the designated HIGH threshold
476 * register (THRn_HIGH). 0x1 = Below Range: The last completed conversion on was less than the value
477 * programmed into the designated LOW threshold register (THRn_LOW). 0x2 = Above Range: The last
478 * completed conversion was greater than the value programmed into the designated HIGH threshold
479 * register (THRn_HIGH). 0x3 = Reserved.
480 */
481#define ADC_DAT_THCMPRANGE(x) (((uint32_t)(((uint32_t)(x)) << ADC_DAT_THCMPRANGE_SHIFT)) & ADC_DAT_THCMPRANGE_MASK)
482#define ADC_DAT_THCMPCROSS_MASK (0xC0000U)
483#define ADC_DAT_THCMPCROSS_SHIFT (18U)
484/*! THCMPCROSS - Threshold Crossing Comparison result. 0x0 = No threshold Crossing detected: The
485 * most recent completed conversion on this channel had the same relationship (above or below) to
486 * the threshold value established by the designated LOW threshold register (THRn_LOW) as did the
487 * previous conversion on this channel. 0x1 = Reserved. 0x2 = Downward Threshold Crossing
488 * Detected. Indicates that a threshold crossing in the downward direction has occurred - i.e. the
489 * previous sample on this channel was above the threshold value established by the designated LOW
490 * threshold register (THRn_LOW) and the current sample is below that threshold. 0x3 = Upward
491 * Threshold Crossing Detected. Indicates that a threshold crossing in the upward direction has occurred
492 * - i.e. the previous sample on this channel was below the threshold value established by the
493 * designated LOW threshold register (THRn_LOW) and the current sample is above that threshold.
494 */
495#define ADC_DAT_THCMPCROSS(x) (((uint32_t)(((uint32_t)(x)) << ADC_DAT_THCMPCROSS_SHIFT)) & ADC_DAT_THCMPCROSS_MASK)
496#define ADC_DAT_CHANNEL_MASK (0x3C000000U)
497#define ADC_DAT_CHANNEL_SHIFT (26U)
498/*! CHANNEL - This field is hard-coded to contain the channel number that this particular register
499 * relates to (i.e. this field will contain 0b0000 for the DAT0 register, 0b0001 for the DAT1
500 * register, etc)
501 */
502#define ADC_DAT_CHANNEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_DAT_CHANNEL_SHIFT)) & ADC_DAT_CHANNEL_MASK)
503#define ADC_DAT_OVERRUN_MASK (0x40000000U)
504#define ADC_DAT_OVERRUN_SHIFT (30U)
505/*! OVERRUN - This bit will be set to a 1 if a new conversion on this channel completes and
506 * overwrites the previous contents of the RESULT field before it has been read - i.e. while the DONE bit
507 * is set. This bit is cleared, along with the DONE bit, whenever this register is read or when
508 * the data related to this channel is read from either of the global SEQn_GDAT registers. This
509 * bit (in any of the 12 registers) will cause an overrun interrupt/DMA trigger to be asserted if
510 * the overrun interrupt is enabled. While it is allowed to include the same channels in both
511 * conversion sequences, doing so may cause erratic behavior of the DONE and OVERRUN bits in the
512 * data registers associated with any of the channels that are shared between the two sequences. Any
513 * erratic OVERRUN behavior will also affect overrun interrupt generation, if enabled.
514 */
515#define ADC_DAT_OVERRUN(x) (((uint32_t)(((uint32_t)(x)) << ADC_DAT_OVERRUN_SHIFT)) & ADC_DAT_OVERRUN_MASK)
516#define ADC_DAT_DATAVALID_MASK (0x80000000U)
517#define ADC_DAT_DATAVALID_SHIFT (31U)
518/*! DATAVALID - This bit is set to 1 when an ADC conversion on this channel completes. This bit is
519 * cleared whenever this register is read or when the data related to this channel is read from
520 * either of the global SEQn_GDAT registers. While it is allowed to include the same channels in
521 * both conversion sequences, doing so may cause erratic behavior of the DONE and OVERRUN bits in
522 * the data registers associated with any of the channels that are shared between the two
523 * sequences. Any erratic OVERRUN behavior will also affect overrun interrupt generation, if enabled.
524 */
525#define ADC_DAT_DATAVALID(x) (((uint32_t)(((uint32_t)(x)) << ADC_DAT_DATAVALID_SHIFT)) & ADC_DAT_DATAVALID_MASK)
526/*! @} */
527
528/* The count of ADC_DAT */
529#define ADC_DAT_COUNT (12U)
530
531/*! @name THR0_LOW - ADC Low Compare Threshold register 0: Contains the lower threshold level for automatic threshold comparison for any channels linked to threshold pair 0. */
532/*! @{ */
533#define ADC_THR0_LOW_THRLOW_MASK (0xFFF0U)
534#define ADC_THR0_LOW_THRLOW_SHIFT (4U)
535/*! THRLOW - Low threshold value against which ADC results will be compared
536 */
537#define ADC_THR0_LOW_THRLOW(x) (((uint32_t)(((uint32_t)(x)) << ADC_THR0_LOW_THRLOW_SHIFT)) & ADC_THR0_LOW_THRLOW_MASK)
538/*! @} */
539
540/*! @name THR1_LOW - ADC Low Compare Threshold register 1: Contains the lower threshold level for automatic threshold comparison for any channels linked to threshold pair 1. */
541/*! @{ */
542#define ADC_THR1_LOW_THRLOW_MASK (0xFFF0U)
543#define ADC_THR1_LOW_THRLOW_SHIFT (4U)
544/*! THRLOW - Low threshold value against which ADC results will be compared
545 */
546#define ADC_THR1_LOW_THRLOW(x) (((uint32_t)(((uint32_t)(x)) << ADC_THR1_LOW_THRLOW_SHIFT)) & ADC_THR1_LOW_THRLOW_MASK)
547/*! @} */
548
549/*! @name THR0_HIGH - ADC High Compare Threshold register 0: Contains the upper threshold level for automatic threshold comparison for any channels linked to threshold pair 0. */
550/*! @{ */
551#define ADC_THR0_HIGH_THRHIGH_MASK (0xFFF0U)
552#define ADC_THR0_HIGH_THRHIGH_SHIFT (4U)
553/*! THRHIGH - High threshold value against which ADC results will be compared
554 */
555#define ADC_THR0_HIGH_THRHIGH(x) (((uint32_t)(((uint32_t)(x)) << ADC_THR0_HIGH_THRHIGH_SHIFT)) & ADC_THR0_HIGH_THRHIGH_MASK)
556/*! @} */
557
558/*! @name THR1_HIGH - ADC High Compare Threshold register 1: Contains the upper threshold level for automatic threshold comparison for any channels linked to threshold pair 1. */
559/*! @{ */
560#define ADC_THR1_HIGH_THRHIGH_MASK (0xFFF0U)
561#define ADC_THR1_HIGH_THRHIGH_SHIFT (4U)
562/*! THRHIGH - High threshold value against which ADC results will be compared
563 */
564#define ADC_THR1_HIGH_THRHIGH(x) (((uint32_t)(((uint32_t)(x)) << ADC_THR1_HIGH_THRHIGH_SHIFT)) & ADC_THR1_HIGH_THRHIGH_MASK)
565/*! @} */
566
567/*! @name CHAN_THRSEL - ADC Channel-Threshold Select register. Specifies which set of threshold compare registers are to be used for each channel */
568/*! @{ */
569#define ADC_CHAN_THRSEL_CH0_THRSEL_MASK (0x1U)
570#define ADC_CHAN_THRSEL_CH0_THRSEL_SHIFT (0U)
571/*! CH0_THRSEL - Threshold select for channel 0.
572 * 0b0..Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers.
573 * 0b1..Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers.
574 */
575#define ADC_CHAN_THRSEL_CH0_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH0_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH0_THRSEL_MASK)
576#define ADC_CHAN_THRSEL_CH1_THRSEL_MASK (0x2U)
577#define ADC_CHAN_THRSEL_CH1_THRSEL_SHIFT (1U)
578/*! CH1_THRSEL - Threshold select for channel 1. See description for channel 0.
579 */
580#define ADC_CHAN_THRSEL_CH1_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH1_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH1_THRSEL_MASK)
581#define ADC_CHAN_THRSEL_CH2_THRSEL_MASK (0x4U)
582#define ADC_CHAN_THRSEL_CH2_THRSEL_SHIFT (2U)
583/*! CH2_THRSEL - Threshold select for channel 2. See description for channel 0.
584 */
585#define ADC_CHAN_THRSEL_CH2_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH2_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH2_THRSEL_MASK)
586#define ADC_CHAN_THRSEL_CH3_THRSEL_MASK (0x8U)
587#define ADC_CHAN_THRSEL_CH3_THRSEL_SHIFT (3U)
588/*! CH3_THRSEL - Threshold select for channel 3. See description for channel 0.
589 */
590#define ADC_CHAN_THRSEL_CH3_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH3_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH3_THRSEL_MASK)
591#define ADC_CHAN_THRSEL_CH4_THRSEL_MASK (0x10U)
592#define ADC_CHAN_THRSEL_CH4_THRSEL_SHIFT (4U)
593/*! CH4_THRSEL - Threshold select for channel 4. See description for channel 0.
594 */
595#define ADC_CHAN_THRSEL_CH4_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH4_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH4_THRSEL_MASK)
596#define ADC_CHAN_THRSEL_CH5_THRSEL_MASK (0x20U)
597#define ADC_CHAN_THRSEL_CH5_THRSEL_SHIFT (5U)
598/*! CH5_THRSEL - Threshold select for channel 5. See description for channel 0.
599 */
600#define ADC_CHAN_THRSEL_CH5_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH5_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH5_THRSEL_MASK)
601#define ADC_CHAN_THRSEL_CH6_THRSEL_MASK (0x40U)
602#define ADC_CHAN_THRSEL_CH6_THRSEL_SHIFT (6U)
603/*! CH6_THRSEL - Threshold select for channel 6. See description for channel 0.
604 */
605#define ADC_CHAN_THRSEL_CH6_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH6_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH6_THRSEL_MASK)
606#define ADC_CHAN_THRSEL_CH7_THRSEL_MASK (0x80U)
607#define ADC_CHAN_THRSEL_CH7_THRSEL_SHIFT (7U)
608/*! CH7_THRSEL - Threshold select for channel 7. See description for channel 0.
609 */
610#define ADC_CHAN_THRSEL_CH7_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH7_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH7_THRSEL_MASK)
611#define ADC_CHAN_THRSEL_CH8_THRSEL_MASK (0x100U)
612#define ADC_CHAN_THRSEL_CH8_THRSEL_SHIFT (8U)
613/*! CH8_THRSEL - Threshold select for channel 8. See description for channel 0.
614 */
615#define ADC_CHAN_THRSEL_CH8_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH8_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH8_THRSEL_MASK)
616#define ADC_CHAN_THRSEL_CH9_THRSEL_MASK (0x200U)
617#define ADC_CHAN_THRSEL_CH9_THRSEL_SHIFT (9U)
618/*! CH9_THRSEL - Threshold select for channel 9. See description for channel 0.
619 */
620#define ADC_CHAN_THRSEL_CH9_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH9_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH9_THRSEL_MASK)
621#define ADC_CHAN_THRSEL_CH10_THRSEL_MASK (0x400U)
622#define ADC_CHAN_THRSEL_CH10_THRSEL_SHIFT (10U)
623/*! CH10_THRSEL - Threshold select for channel 10. See description for channel 0.
624 */
625#define ADC_CHAN_THRSEL_CH10_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH10_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH10_THRSEL_MASK)
626#define ADC_CHAN_THRSEL_CH11_THRSEL_MASK (0x800U)
627#define ADC_CHAN_THRSEL_CH11_THRSEL_SHIFT (11U)
628/*! CH11_THRSEL - Threshold select for channel 11. See description for channel 0.
629 */
630#define ADC_CHAN_THRSEL_CH11_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH11_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH11_THRSEL_MASK)
631/*! @} */
632
633/*! @name INTEN - ADC Interrupt Enable register. This register contains enable bits that enable the sequence-A, sequence-B, threshold compare and data overrun interrupts to be generated. */
634/*! @{ */
635#define ADC_INTEN_SEQA_INTEN_MASK (0x1U)
636#define ADC_INTEN_SEQA_INTEN_SHIFT (0U)
637/*! SEQA_INTEN - Sequence A interrupt enable.
638 * 0b0..Disabled. The sequence A interrupt/DMA trigger is disabled.
639 * 0b1..Enabled. The sequence A interrupt/DMA trigger is enabled and will be asserted either upon completion of
640 * each individual conversion performed as part of sequence A, or upon completion of the entire A sequence of
641 * conversions, depending on the MODE bit in the SEQA_CTRL register.
642 */
643#define ADC_INTEN_SEQA_INTEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_SEQA_INTEN_SHIFT)) & ADC_INTEN_SEQA_INTEN_MASK)
644#define ADC_INTEN_SEQB_INTEN_MASK (0x2U)
645#define ADC_INTEN_SEQB_INTEN_SHIFT (1U)
646/*! SEQB_INTEN - Sequence B interrupt enable.
647 * 0b0..Disabled. The sequence B interrupt/DMA trigger is disabled.
648 * 0b1..Enabled. The sequence B interrupt/DMA trigger is enabled and will be asserted either upon completion of
649 * each individual conversion performed as part of sequence B, or upon completion of the entire B sequence of
650 * conversions, depending on the MODE bit in the SEQB_CTRL register.
651 */
652#define ADC_INTEN_SEQB_INTEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_SEQB_INTEN_SHIFT)) & ADC_INTEN_SEQB_INTEN_MASK)
653#define ADC_INTEN_OVR_INTEN_MASK (0x4U)
654#define ADC_INTEN_OVR_INTEN_SHIFT (2U)
655/*! OVR_INTEN - Overrun interrupt enable.
656 * 0b0..Disabled. The overrun interrupt is disabled.
657 * 0b1..Enabled. The overrun interrupt is enabled. Detection of an overrun condition on any of the 12 channel
658 * data registers will cause an overrun interrupt/DMA trigger. In addition, if the MODE bit for a particular
659 * sequence is 0, then an overrun in the global data register for that sequence will also cause this
660 * interrupt/DMA trigger to be asserted.
661 */
662#define ADC_INTEN_OVR_INTEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_OVR_INTEN_SHIFT)) & ADC_INTEN_OVR_INTEN_MASK)
663#define ADC_INTEN_ADCMPINTEN0_MASK (0x18U)
664#define ADC_INTEN_ADCMPINTEN0_SHIFT (3U)
665/*! ADCMPINTEN0 - Threshold comparison interrupt enable for channel 0.
666 * 0b00..Disabled.
667 * 0b01..Outside threshold.
668 * 0b10..Crossing threshold.
669 * 0b11..Reserved
670 */
671#define ADC_INTEN_ADCMPINTEN0(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN0_SHIFT)) & ADC_INTEN_ADCMPINTEN0_MASK)
672#define ADC_INTEN_ADCMPINTEN1_MASK (0x60U)
673#define ADC_INTEN_ADCMPINTEN1_SHIFT (5U)
674/*! ADCMPINTEN1 - Channel 1 threshold comparison interrupt enable. See description for channel 0.
675 */
676#define ADC_INTEN_ADCMPINTEN1(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN1_SHIFT)) & ADC_INTEN_ADCMPINTEN1_MASK)
677#define ADC_INTEN_ADCMPINTEN2_MASK (0x180U)
678#define ADC_INTEN_ADCMPINTEN2_SHIFT (7U)
679/*! ADCMPINTEN2 - Channel 2 threshold comparison interrupt enable. See description for channel 0.
680 */
681#define ADC_INTEN_ADCMPINTEN2(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN2_SHIFT)) & ADC_INTEN_ADCMPINTEN2_MASK)
682#define ADC_INTEN_ADCMPINTEN3_MASK (0x600U)
683#define ADC_INTEN_ADCMPINTEN3_SHIFT (9U)
684/*! ADCMPINTEN3 - Channel 3 threshold comparison interrupt enable. See description for channel 0.
685 */
686#define ADC_INTEN_ADCMPINTEN3(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN3_SHIFT)) & ADC_INTEN_ADCMPINTEN3_MASK)
687#define ADC_INTEN_ADCMPINTEN4_MASK (0x1800U)
688#define ADC_INTEN_ADCMPINTEN4_SHIFT (11U)
689/*! ADCMPINTEN4 - Channel 4 threshold comparison interrupt enable. See description for channel 0.
690 */
691#define ADC_INTEN_ADCMPINTEN4(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN4_SHIFT)) & ADC_INTEN_ADCMPINTEN4_MASK)
692#define ADC_INTEN_ADCMPINTEN5_MASK (0x6000U)
693#define ADC_INTEN_ADCMPINTEN5_SHIFT (13U)
694/*! ADCMPINTEN5 - Channel 5 threshold comparison interrupt enable. See description for channel 0.
695 */
696#define ADC_INTEN_ADCMPINTEN5(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN5_SHIFT)) & ADC_INTEN_ADCMPINTEN5_MASK)
697#define ADC_INTEN_ADCMPINTEN6_MASK (0x18000U)
698#define ADC_INTEN_ADCMPINTEN6_SHIFT (15U)
699/*! ADCMPINTEN6 - Channel 6 threshold comparison interrupt enable. See description for channel 0.
700 */
701#define ADC_INTEN_ADCMPINTEN6(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN6_SHIFT)) & ADC_INTEN_ADCMPINTEN6_MASK)
702#define ADC_INTEN_ADCMPINTEN7_MASK (0x60000U)
703#define ADC_INTEN_ADCMPINTEN7_SHIFT (17U)
704/*! ADCMPINTEN7 - Channel 7 threshold comparison interrupt enable. See description for channel 0.
705 */
706#define ADC_INTEN_ADCMPINTEN7(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN7_SHIFT)) & ADC_INTEN_ADCMPINTEN7_MASK)
707#define ADC_INTEN_ADCMPINTEN8_MASK (0x180000U)
708#define ADC_INTEN_ADCMPINTEN8_SHIFT (19U)
709/*! ADCMPINTEN8 - Channel 8 threshold comparison interrupt enable. See description for channel 0.
710 */
711#define ADC_INTEN_ADCMPINTEN8(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN8_SHIFT)) & ADC_INTEN_ADCMPINTEN8_MASK)
712#define ADC_INTEN_ADCMPINTEN9_MASK (0x600000U)
713#define ADC_INTEN_ADCMPINTEN9_SHIFT (21U)
714/*! ADCMPINTEN9 - Channel 9 threshold comparison interrupt enable. See description for channel 0.
715 */
716#define ADC_INTEN_ADCMPINTEN9(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN9_SHIFT)) & ADC_INTEN_ADCMPINTEN9_MASK)
717#define ADC_INTEN_ADCMPINTEN10_MASK (0x1800000U)
718#define ADC_INTEN_ADCMPINTEN10_SHIFT (23U)
719/*! ADCMPINTEN10 - Channel 10 threshold comparison interrupt enable. See description for channel 0.
720 */
721#define ADC_INTEN_ADCMPINTEN10(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN10_SHIFT)) & ADC_INTEN_ADCMPINTEN10_MASK)
722#define ADC_INTEN_ADCMPINTEN11_MASK (0x6000000U)
723#define ADC_INTEN_ADCMPINTEN11_SHIFT (25U)
724/*! ADCMPINTEN11 - Channel 21 threshold comparison interrupt enable. See description for channel 0.
725 */
726#define ADC_INTEN_ADCMPINTEN11(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN11_SHIFT)) & ADC_INTEN_ADCMPINTEN11_MASK)
727/*! @} */
728
729/*! @name FLAGS - ADC Flags register. Contains the four interrupt/DMA trigger flags and the individual component overrun and threshold-compare flags. (The overrun bits replicate information stored in the result registers). */
730/*! @{ */
731#define ADC_FLAGS_THCMP0_MASK (0x1U)
732#define ADC_FLAGS_THCMP0_SHIFT (0U)
733/*! THCMP0 - Threshold comparison event on Channel 0. Set to 1 upon either an out-of-range result or
734 * a threshold-crossing result if enabled to do so in the INTEN register. This bit is cleared by
735 * writing a 1.
736 */
737#define ADC_FLAGS_THCMP0(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP0_SHIFT)) & ADC_FLAGS_THCMP0_MASK)
738#define ADC_FLAGS_THCMP1_MASK (0x2U)
739#define ADC_FLAGS_THCMP1_SHIFT (1U)
740/*! THCMP1 - Threshold comparison event on Channel 1. See description for channel 0.
741 */
742#define ADC_FLAGS_THCMP1(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP1_SHIFT)) & ADC_FLAGS_THCMP1_MASK)
743#define ADC_FLAGS_THCMP2_MASK (0x4U)
744#define ADC_FLAGS_THCMP2_SHIFT (2U)
745/*! THCMP2 - Threshold comparison event on Channel 2. See description for channel 0.
746 */
747#define ADC_FLAGS_THCMP2(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP2_SHIFT)) & ADC_FLAGS_THCMP2_MASK)
748#define ADC_FLAGS_THCMP3_MASK (0x8U)
749#define ADC_FLAGS_THCMP3_SHIFT (3U)
750/*! THCMP3 - Threshold comparison event on Channel 3. See description for channel 0.
751 */
752#define ADC_FLAGS_THCMP3(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP3_SHIFT)) & ADC_FLAGS_THCMP3_MASK)
753#define ADC_FLAGS_THCMP4_MASK (0x10U)
754#define ADC_FLAGS_THCMP4_SHIFT (4U)
755/*! THCMP4 - Threshold comparison event on Channel 4. See description for channel 0.
756 */
757#define ADC_FLAGS_THCMP4(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP4_SHIFT)) & ADC_FLAGS_THCMP4_MASK)
758#define ADC_FLAGS_THCMP5_MASK (0x20U)
759#define ADC_FLAGS_THCMP5_SHIFT (5U)
760/*! THCMP5 - Threshold comparison event on Channel 5. See description for channel 0.
761 */
762#define ADC_FLAGS_THCMP5(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP5_SHIFT)) & ADC_FLAGS_THCMP5_MASK)
763#define ADC_FLAGS_THCMP6_MASK (0x40U)
764#define ADC_FLAGS_THCMP6_SHIFT (6U)
765/*! THCMP6 - Threshold comparison event on Channel 6. See description for channel 0.
766 */
767#define ADC_FLAGS_THCMP6(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP6_SHIFT)) & ADC_FLAGS_THCMP6_MASK)
768#define ADC_FLAGS_THCMP7_MASK (0x80U)
769#define ADC_FLAGS_THCMP7_SHIFT (7U)
770/*! THCMP7 - Threshold comparison event on Channel 7. See description for channel 0.
771 */
772#define ADC_FLAGS_THCMP7(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP7_SHIFT)) & ADC_FLAGS_THCMP7_MASK)
773#define ADC_FLAGS_THCMP8_MASK (0x100U)
774#define ADC_FLAGS_THCMP8_SHIFT (8U)
775/*! THCMP8 - Threshold comparison event on Channel 8. See description for channel 0.
776 */
777#define ADC_FLAGS_THCMP8(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP8_SHIFT)) & ADC_FLAGS_THCMP8_MASK)
778#define ADC_FLAGS_THCMP9_MASK (0x200U)
779#define ADC_FLAGS_THCMP9_SHIFT (9U)
780/*! THCMP9 - Threshold comparison event on Channel 9. See description for channel 0.
781 */
782#define ADC_FLAGS_THCMP9(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP9_SHIFT)) & ADC_FLAGS_THCMP9_MASK)
783#define ADC_FLAGS_THCMP10_MASK (0x400U)
784#define ADC_FLAGS_THCMP10_SHIFT (10U)
785/*! THCMP10 - Threshold comparison event on Channel 10. See description for channel 0.
786 */
787#define ADC_FLAGS_THCMP10(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP10_SHIFT)) & ADC_FLAGS_THCMP10_MASK)
788#define ADC_FLAGS_THCMP11_MASK (0x800U)
789#define ADC_FLAGS_THCMP11_SHIFT (11U)
790/*! THCMP11 - Threshold comparison event on Channel 11. See description for channel 0.
791 */
792#define ADC_FLAGS_THCMP11(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP11_SHIFT)) & ADC_FLAGS_THCMP11_MASK)
793#define ADC_FLAGS_OVERRUN0_MASK (0x1000U)
794#define ADC_FLAGS_OVERRUN0_SHIFT (12U)
795/*! OVERRUN0 - Mirrors the OVERRRUN status flag from the result register for ADC channel 0
796 */
797#define ADC_FLAGS_OVERRUN0(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN0_SHIFT)) & ADC_FLAGS_OVERRUN0_MASK)
798#define ADC_FLAGS_OVERRUN1_MASK (0x2000U)
799#define ADC_FLAGS_OVERRUN1_SHIFT (13U)
800/*! OVERRUN1 - Mirrors the OVERRRUN status flag from the result register for ADC channel 1
801 */
802#define ADC_FLAGS_OVERRUN1(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN1_SHIFT)) & ADC_FLAGS_OVERRUN1_MASK)
803#define ADC_FLAGS_OVERRUN2_MASK (0x4000U)
804#define ADC_FLAGS_OVERRUN2_SHIFT (14U)
805/*! OVERRUN2 - Mirrors the OVERRRUN status flag from the result register for ADC channel 2
806 */
807#define ADC_FLAGS_OVERRUN2(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN2_SHIFT)) & ADC_FLAGS_OVERRUN2_MASK)
808#define ADC_FLAGS_OVERRUN3_MASK (0x8000U)
809#define ADC_FLAGS_OVERRUN3_SHIFT (15U)
810/*! OVERRUN3 - Mirrors the OVERRRUN status flag from the result register for ADC channel 3
811 */
812#define ADC_FLAGS_OVERRUN3(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN3_SHIFT)) & ADC_FLAGS_OVERRUN3_MASK)
813#define ADC_FLAGS_OVERRUN4_MASK (0x10000U)
814#define ADC_FLAGS_OVERRUN4_SHIFT (16U)
815/*! OVERRUN4 - Mirrors the OVERRRUN status flag from the result register for ADC channel 4
816 */
817#define ADC_FLAGS_OVERRUN4(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN4_SHIFT)) & ADC_FLAGS_OVERRUN4_MASK)
818#define ADC_FLAGS_OVERRUN5_MASK (0x20000U)
819#define ADC_FLAGS_OVERRUN5_SHIFT (17U)
820/*! OVERRUN5 - Mirrors the OVERRRUN status flag from the result register for ADC channel 5
821 */
822#define ADC_FLAGS_OVERRUN5(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN5_SHIFT)) & ADC_FLAGS_OVERRUN5_MASK)
823#define ADC_FLAGS_OVERRUN6_MASK (0x40000U)
824#define ADC_FLAGS_OVERRUN6_SHIFT (18U)
825/*! OVERRUN6 - Mirrors the OVERRRUN status flag from the result register for ADC channel 6
826 */
827#define ADC_FLAGS_OVERRUN6(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN6_SHIFT)) & ADC_FLAGS_OVERRUN6_MASK)
828#define ADC_FLAGS_OVERRUN7_MASK (0x80000U)
829#define ADC_FLAGS_OVERRUN7_SHIFT (19U)
830/*! OVERRUN7 - Mirrors the OVERRRUN status flag from the result register for ADC channel 7
831 */
832#define ADC_FLAGS_OVERRUN7(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN7_SHIFT)) & ADC_FLAGS_OVERRUN7_MASK)
833#define ADC_FLAGS_OVERRUN8_MASK (0x100000U)
834#define ADC_FLAGS_OVERRUN8_SHIFT (20U)
835/*! OVERRUN8 - Mirrors the OVERRRUN status flag from the result register for ADC channel 8
836 */
837#define ADC_FLAGS_OVERRUN8(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN8_SHIFT)) & ADC_FLAGS_OVERRUN8_MASK)
838#define ADC_FLAGS_OVERRUN9_MASK (0x200000U)
839#define ADC_FLAGS_OVERRUN9_SHIFT (21U)
840/*! OVERRUN9 - Mirrors the OVERRRUN status flag from the result register for ADC channel 9
841 */
842#define ADC_FLAGS_OVERRUN9(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN9_SHIFT)) & ADC_FLAGS_OVERRUN9_MASK)
843#define ADC_FLAGS_OVERRUN10_MASK (0x400000U)
844#define ADC_FLAGS_OVERRUN10_SHIFT (22U)
845/*! OVERRUN10 - Mirrors the OVERRRUN status flag from the result register for ADC channel 10
846 */
847#define ADC_FLAGS_OVERRUN10(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN10_SHIFT)) & ADC_FLAGS_OVERRUN10_MASK)
848#define ADC_FLAGS_OVERRUN11_MASK (0x800000U)
849#define ADC_FLAGS_OVERRUN11_SHIFT (23U)
850/*! OVERRUN11 - Mirrors the OVERRRUN status flag from the result register for ADC channel 11
851 */
852#define ADC_FLAGS_OVERRUN11(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN11_SHIFT)) & ADC_FLAGS_OVERRUN11_MASK)
853#define ADC_FLAGS_SEQA_OVR_MASK (0x1000000U)
854#define ADC_FLAGS_SEQA_OVR_SHIFT (24U)
855/*! SEQA_OVR - Mirrors the global OVERRUN status flag in the SEQA_GDAT register
856 */
857#define ADC_FLAGS_SEQA_OVR(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_SEQA_OVR_SHIFT)) & ADC_FLAGS_SEQA_OVR_MASK)
858#define ADC_FLAGS_SEQB_OVR_MASK (0x2000000U)
859#define ADC_FLAGS_SEQB_OVR_SHIFT (25U)
860/*! SEQB_OVR - Mirrors the global OVERRUN status flag in the SEQB_GDAT register
861 */
862#define ADC_FLAGS_SEQB_OVR(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_SEQB_OVR_SHIFT)) & ADC_FLAGS_SEQB_OVR_MASK)
863#define ADC_FLAGS_SEQA_INT_MASK (0x10000000U)
864#define ADC_FLAGS_SEQA_INT_SHIFT (28U)
865/*! SEQA_INT - Sequence A interrupt/DMA trigger. If the MODE bit in the SEQA_CTRL register is 0,
866 * this flag will mirror the DATAVALID bit in the sequence A global data register (SEQA_GDAT), which
867 * is set at the end of every ADC conversion performed as part of sequence A. It will be cleared
868 * automatically when the SEQA_GDAT register is read. If the MODE bit in the SEQA_CTRL register
869 * is 1, this flag will be set upon completion of an entire A sequence. In this case it must be
870 * cleared by writing a 1 to this SEQA_INT bit. This interrupt must be enabled in the INTEN
871 * register.
872 */
873#define ADC_FLAGS_SEQA_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_SEQA_INT_SHIFT)) & ADC_FLAGS_SEQA_INT_MASK)
874#define ADC_FLAGS_SEQB_INT_MASK (0x20000000U)
875#define ADC_FLAGS_SEQB_INT_SHIFT (29U)
876/*! SEQB_INT - Sequence A interrupt/DMA trigger. If the MODE bit in the SEQB_CTRL register is 0,
877 * this flag will mirror the DATAVALID bit in the sequence A global data register (SEQB_GDAT), which
878 * is set at the end of every ADC conversion performed as part of sequence B. It will be cleared
879 * automatically when the SEQB_GDAT register is read. If the MODE bit in the SEQB_CTRL register
880 * is 1, this flag will be set upon completion of an entire B sequence. In this case it must be
881 * cleared by writing a 1 to this SEQB_INT bit. This interrupt must be enabled in the INTEN
882 * register.
883 */
884#define ADC_FLAGS_SEQB_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_SEQB_INT_SHIFT)) & ADC_FLAGS_SEQB_INT_MASK)
885#define ADC_FLAGS_THCMP_INT_MASK (0x40000000U)
886#define ADC_FLAGS_THCMP_INT_SHIFT (30U)
887/*! THCMP_INT - Threshold Comparison Interrupt. This bit will be set if any of the THCMP flags in
888 * the lower bits of this register are set to 1 (due to an enabled out-of-range or
889 * threshold-crossing event on any channel). Each type of threshold comparison interrupt on each channel must be
890 * individually enabled in the INTEN register to cause this interrupt. This bit will be cleared
891 * when all of the individual threshold flags are cleared via writing 1s to those bits.
892 */
893#define ADC_FLAGS_THCMP_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP_INT_SHIFT)) & ADC_FLAGS_THCMP_INT_MASK)
894#define ADC_FLAGS_OVR_INT_MASK (0x80000000U)
895#define ADC_FLAGS_OVR_INT_SHIFT (31U)
896/*! OVR_INT - Overrun Interrupt flag. Any overrun bit in any of the individual channel data
897 * registers will cause this interrupt. In addition, if the MODE bit in either of the SEQn_CTRL registers
898 * is 0 then the OVERRUN bit in the corresponding SEQn_GDAT register will also cause this
899 * interrupt. This interrupt must be enabled in the INTEN register. This bit will be cleared when all
900 * of the individual overrun bits have been cleared via reading the corresponding data registers.
901 */
902#define ADC_FLAGS_OVR_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVR_INT_SHIFT)) & ADC_FLAGS_OVR_INT_MASK)
903/*! @} */
904
905/*! @name STARTUP - ADC Startup register. */
906/*! @{ */
907#define ADC_STARTUP_ADC_ENA_MASK (0x1U)
908#define ADC_STARTUP_ADC_ENA_SHIFT (0U)
909/*! ADC_ENA - ADC Enable bit. This bit can only be set to a 1 by software. It is cleared
910 * automatically whenever the ADC is powered down. This bit must not be set until at least 10 microseconds
911 * after the ADC is powered up (typically by altering a system-level ADC power control bit).
912 */
913#define ADC_STARTUP_ADC_ENA(x) (((uint32_t)(((uint32_t)(x)) << ADC_STARTUP_ADC_ENA_SHIFT)) & ADC_STARTUP_ADC_ENA_MASK)
914#define ADC_STARTUP_ADC_INIT_MASK (0x2U)
915#define ADC_STARTUP_ADC_INIT_SHIFT (1U)
916/*! ADC_INIT - ADC Initialization. After enabling the ADC (setting the ADC_ENA bit), the API routine
917 * will EITHER set this bit or the CALIB bit in the CALIB register, depending on whether or not
918 * calibration is required. Setting this bit will launch the 'dummy' conversion cycle that is
919 * required if a calibration is not performed. It will also reload the stored calibration value from
920 * a previous calibration unless the BYPASSCAL bit is set. This bit should only be set AFTER the
921 * ADC_ENA bit is set and after the CALIREQD bit is tested to determine whether a calibration or
922 * an ADC dummy conversion cycle is required. It should not be set during the same write that
923 * sets the ADC_ENA bit. This bit can only be set to a '1' by software. It is cleared automatically
924 * when the 'dummy' conversion cycle completes.
925 */
926#define ADC_STARTUP_ADC_INIT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STARTUP_ADC_INIT_SHIFT)) & ADC_STARTUP_ADC_INIT_MASK)
927/*! @} */
928
929/*! @name CALIB - ADC Calibration register. */
930/*! @{ */
931#define ADC_CALIB_CALIB_MASK (0x1U)
932#define ADC_CALIB_CALIB_SHIFT (0U)
933/*! CALIB - Calibration request. Setting this bit will launch an ADC calibration cycle. This bit can
934 * only be set to a '1' by software. It is cleared automatically when the calibration cycle
935 * completes.
936 */
937#define ADC_CALIB_CALIB(x) (((uint32_t)(((uint32_t)(x)) << ADC_CALIB_CALIB_SHIFT)) & ADC_CALIB_CALIB_MASK)
938#define ADC_CALIB_CALREQD_MASK (0x2U)
939#define ADC_CALIB_CALREQD_SHIFT (1U)
940/*! CALREQD - Calibration required. This read-only bit indicates if calibration is required when
941 * enabling the ADC. CALREQD will be '1' if no calibration has been run since the chip was
942 * powered-up and if the BYPASSCAL bit in the CTRL register is low. Software will test this bit to
943 * determine whether to initiate a calibration cycle or whether to set the ADC_INIT bit (in the STARTUP
944 * register) to launch the ADC initialization process which includes a 'dummy' conversion cycle.
945 * Note: A 'dummy' conversion cycle requires approximately 6 ADC clocks as opposed to 81 clocks
946 * required for calibration.
947 */
948#define ADC_CALIB_CALREQD(x) (((uint32_t)(((uint32_t)(x)) << ADC_CALIB_CALREQD_SHIFT)) & ADC_CALIB_CALREQD_MASK)
949#define ADC_CALIB_CALVALUE_MASK (0x1FCU)
950#define ADC_CALIB_CALVALUE_SHIFT (2U)
951/*! CALVALUE - Calibration Value. This read-only field displays the calibration value established
952 * during last calibration cycle. This value is not typically of any use to the user.
953 */
954#define ADC_CALIB_CALVALUE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CALIB_CALVALUE_SHIFT)) & ADC_CALIB_CALVALUE_MASK)
955/*! @} */
956
957
958/*!
959 * @}
960 */ /* end of group ADC_Register_Masks */
961
962
963/* ADC - Peripheral instance base addresses */
964/** Peripheral ADC0 base address */
965#define ADC0_BASE (0x400A0000u)
966/** Peripheral ADC0 base pointer */
967#define ADC0 ((ADC_Type *)ADC0_BASE)
968/** Array initializer of ADC peripheral base addresses */
969#define ADC_BASE_ADDRS { ADC0_BASE }
970/** Array initializer of ADC peripheral base pointers */
971#define ADC_BASE_PTRS { ADC0 }
972/** Interrupt vectors for the ADC peripheral type */
973#define ADC_SEQ_IRQS { ADC0_SEQA_IRQn, ADC0_SEQB_IRQn }
974#define ADC_THCMP_IRQS { ADC0_THCMP_IRQn }
975
976/*!
977 * @}
978 */ /* end of group ADC_Peripheral_Access_Layer */
979
980
981/* ----------------------------------------------------------------------------
982 -- ASYNC_SYSCON Peripheral Access Layer
983 ---------------------------------------------------------------------------- */
984
985/*!
986 * @addtogroup ASYNC_SYSCON_Peripheral_Access_Layer ASYNC_SYSCON Peripheral Access Layer
987 * @{
988 */
989
990/** ASYNC_SYSCON - Register Layout Typedef */
991typedef struct {
992 __IO uint32_t ASYNCPRESETCTRL; /**< Async peripheral reset control, offset: 0x0 */
993 __O uint32_t ASYNCPRESETCTRLSET; /**< Set bits in ASYNCPRESETCTRL, offset: 0x4 */
994 __O uint32_t ASYNCPRESETCTRLCLR; /**< Clear bits in ASYNCPRESETCTRL, offset: 0x8 */
995 uint8_t RESERVED_0[4];
996 __IO uint32_t ASYNCAPBCLKCTRL; /**< Async peripheral clock control, offset: 0x10 */
997 __O uint32_t ASYNCAPBCLKCTRLSET; /**< Set bits in ASYNCAPBCLKCTRL, offset: 0x14 */
998 __O uint32_t ASYNCAPBCLKCTRLCLR; /**< Clear bits in ASYNCAPBCLKCTRL, offset: 0x18 */
999 uint8_t RESERVED_1[4];
1000 __IO uint32_t ASYNCAPBCLKSELA; /**< Async APB clock source select A, offset: 0x20 */
1001} ASYNC_SYSCON_Type;
1002
1003/* ----------------------------------------------------------------------------
1004 -- ASYNC_SYSCON Register Masks
1005 ---------------------------------------------------------------------------- */
1006
1007/*!
1008 * @addtogroup ASYNC_SYSCON_Register_Masks ASYNC_SYSCON Register Masks
1009 * @{
1010 */
1011
1012/*! @name ASYNCPRESETCTRL - Async peripheral reset control */
1013/*! @{ */
1014#define ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER3_MASK (0x2000U)
1015#define ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER3_SHIFT (13U)
1016/*! CTIMER3 - Standard counter/timer CTIMER3 reset control. 0 = Clear reset to this function. 1 = Assert reset to this function.
1017 */
1018#define ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER3(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER3_SHIFT)) & ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER3_MASK)
1019#define ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER4_MASK (0x4000U)
1020#define ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER4_SHIFT (14U)
1021/*! CTIMER4 - Standard counter/timer CTIMER4 reset control. 0 = Clear reset to this function. 1 = Assert reset to this function.
1022 */
1023#define ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER4(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER4_SHIFT)) & ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER4_MASK)
1024/*! @} */
1025
1026/*! @name ASYNCPRESETCTRLSET - Set bits in ASYNCPRESETCTRL */
1027/*! @{ */
1028#define ASYNC_SYSCON_ASYNCPRESETCTRLSET_ARST_SET_MASK (0xFFFFFFFFU)
1029#define ASYNC_SYSCON_ASYNCPRESETCTRLSET_ARST_SET_SHIFT (0U)
1030/*! ARST_SET - Writing ones to this register sets the corresponding bit or bits in the
1031 * ASYNCPRESETCTRL register, if they are implemented. Bits that do not correspond to defined bits in
1032 * ASYNCPRESETCTRL are reserved and only zeroes should be written to them.
1033 */
1034#define ASYNC_SYSCON_ASYNCPRESETCTRLSET_ARST_SET(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCPRESETCTRLSET_ARST_SET_SHIFT)) & ASYNC_SYSCON_ASYNCPRESETCTRLSET_ARST_SET_MASK)
1035/*! @} */
1036
1037/*! @name ASYNCPRESETCTRLCLR - Clear bits in ASYNCPRESETCTRL */
1038/*! @{ */
1039#define ASYNC_SYSCON_ASYNCPRESETCTRLCLR_ARST_CLR_MASK (0xFFFFFFFFU)
1040#define ASYNC_SYSCON_ASYNCPRESETCTRLCLR_ARST_CLR_SHIFT (0U)
1041/*! ARST_CLR - Writing ones to this register clears the corresponding bit or bits in the
1042 * ASYNCPRESETCTRL register, if they are implemented. Bits that do not correspond to defined bits in
1043 * ASYNCPRESETCTRL are reserved and only zeroes should be written to them.
1044 */
1045#define ASYNC_SYSCON_ASYNCPRESETCTRLCLR_ARST_CLR(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCPRESETCTRLCLR_ARST_CLR_SHIFT)) & ASYNC_SYSCON_ASYNCPRESETCTRLCLR_ARST_CLR_MASK)
1046/*! @} */
1047
1048/*! @name ASYNCAPBCLKCTRL - Async peripheral clock control */
1049/*! @{ */
1050#define ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER3_MASK (0x2000U)
1051#define ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER3_SHIFT (13U)
1052/*! CTIMER3 - Controls the clock for CTIMER3. 0 = Disable; 1 = Enable.
1053 */
1054#define ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER3(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER3_SHIFT)) & ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER3_MASK)
1055#define ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER4_MASK (0x4000U)
1056#define ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER4_SHIFT (14U)
1057/*! CTIMER4 - Controls the clock for CTIMER4. 0 = Disable; 1 = Enable.
1058 */
1059#define ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER4(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER4_SHIFT)) & ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER4_MASK)
1060/*! @} */
1061
1062/*! @name ASYNCAPBCLKCTRLSET - Set bits in ASYNCAPBCLKCTRL */
1063/*! @{ */
1064#define ASYNC_SYSCON_ASYNCAPBCLKCTRLSET_ACLK_SET_MASK (0xFFFFFFFFU)
1065#define ASYNC_SYSCON_ASYNCAPBCLKCTRLSET_ACLK_SET_SHIFT (0U)
1066/*! ACLK_SET - Writing ones to this register sets the corresponding bit or bits in the
1067 * ASYNCAPBCLKCTRL register, if they are implemented. Bits that do not correspond to defined bits in
1068 * ASYNCPRESETCTRL are reserved and only zeroes should be written to them.
1069 */
1070#define ASYNC_SYSCON_ASYNCAPBCLKCTRLSET_ACLK_SET(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCAPBCLKCTRLSET_ACLK_SET_SHIFT)) & ASYNC_SYSCON_ASYNCAPBCLKCTRLSET_ACLK_SET_MASK)
1071/*! @} */
1072
1073/*! @name ASYNCAPBCLKCTRLCLR - Clear bits in ASYNCAPBCLKCTRL */
1074/*! @{ */
1075#define ASYNC_SYSCON_ASYNCAPBCLKCTRLCLR_ACLK_CLR_MASK (0xFFFFFFFFU)
1076#define ASYNC_SYSCON_ASYNCAPBCLKCTRLCLR_ACLK_CLR_SHIFT (0U)
1077/*! ACLK_CLR - Writing ones to this register clears the corresponding bit or bits in the
1078 * ASYNCAPBCLKCTRL register, if they are implemented. Bits that do not correspond to defined bits in
1079 * ASYNCAPBCLKCTRL are reserved and only zeroes should be written to them.
1080 */
1081#define ASYNC_SYSCON_ASYNCAPBCLKCTRLCLR_ACLK_CLR(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCAPBCLKCTRLCLR_ACLK_CLR_SHIFT)) & ASYNC_SYSCON_ASYNCAPBCLKCTRLCLR_ACLK_CLR_MASK)
1082/*! @} */
1083
1084/*! @name ASYNCAPBCLKSELA - Async APB clock source select A */
1085/*! @{ */
1086#define ASYNC_SYSCON_ASYNCAPBCLKSELA_SEL_MASK (0x3U)
1087#define ASYNC_SYSCON_ASYNCAPBCLKSELA_SEL_SHIFT (0U)
1088/*! SEL - Clock source for asynchronous clock source selector A
1089 * 0b00..Main clock
1090 * 0b01..FRO 12 MHz
1091 * 0b10..Reserved setting
1092 * 0b11..Reserved setting
1093 */
1094#define ASYNC_SYSCON_ASYNCAPBCLKSELA_SEL(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCAPBCLKSELA_SEL_SHIFT)) & ASYNC_SYSCON_ASYNCAPBCLKSELA_SEL_MASK)
1095/*! @} */
1096
1097
1098/*!
1099 * @}
1100 */ /* end of group ASYNC_SYSCON_Register_Masks */
1101
1102
1103/* ASYNC_SYSCON - Peripheral instance base addresses */
1104/** Peripheral ASYNC_SYSCON base address */
1105#define ASYNC_SYSCON_BASE (0x40040000u)
1106/** Peripheral ASYNC_SYSCON base pointer */
1107#define ASYNC_SYSCON ((ASYNC_SYSCON_Type *)ASYNC_SYSCON_BASE)
1108/** Array initializer of ASYNC_SYSCON peripheral base addresses */
1109#define ASYNC_SYSCON_BASE_ADDRS { ASYNC_SYSCON_BASE }
1110/** Array initializer of ASYNC_SYSCON peripheral base pointers */
1111#define ASYNC_SYSCON_BASE_PTRS { ASYNC_SYSCON }
1112
1113/*!
1114 * @}
1115 */ /* end of group ASYNC_SYSCON_Peripheral_Access_Layer */
1116
1117
1118/* ----------------------------------------------------------------------------
1119 -- CRC Peripheral Access Layer
1120 ---------------------------------------------------------------------------- */
1121
1122/*!
1123 * @addtogroup CRC_Peripheral_Access_Layer CRC Peripheral Access Layer
1124 * @{
1125 */
1126
1127/** CRC - Register Layout Typedef */
1128typedef struct {
1129 __IO uint32_t MODE; /**< CRC mode register, offset: 0x0 */
1130 __IO uint32_t SEED; /**< CRC seed register, offset: 0x4 */
1131 union { /* offset: 0x8 */
1132 __I uint32_t SUM; /**< CRC checksum register, offset: 0x8 */
1133 __O uint32_t WR_DATA; /**< CRC data register, offset: 0x8 */
1134 };
1135} CRC_Type;
1136
1137/* ----------------------------------------------------------------------------
1138 -- CRC Register Masks
1139 ---------------------------------------------------------------------------- */
1140
1141/*!
1142 * @addtogroup CRC_Register_Masks CRC Register Masks
1143 * @{
1144 */
1145
1146/*! @name MODE - CRC mode register */
1147/*! @{ */
1148#define CRC_MODE_CRC_POLY_MASK (0x3U)
1149#define CRC_MODE_CRC_POLY_SHIFT (0U)
1150/*! CRC_POLY - CRC polynomial: 1X = CRC-32 polynomial 01 = CRC-16 polynomial 00 = CRC-CCITT polynomial
1151 */
1152#define CRC_MODE_CRC_POLY(x) (((uint32_t)(((uint32_t)(x)) << CRC_MODE_CRC_POLY_SHIFT)) & CRC_MODE_CRC_POLY_MASK)
1153#define CRC_MODE_BIT_RVS_WR_MASK (0x4U)
1154#define CRC_MODE_BIT_RVS_WR_SHIFT (2U)
1155/*! BIT_RVS_WR - Data bit order: 1 = Bit order reverse for CRC_WR_DATA (per byte) 0 = No bit order reverse for CRC_WR_DATA (per byte)
1156 */
1157#define CRC_MODE_BIT_RVS_WR(x) (((uint32_t)(((uint32_t)(x)) << CRC_MODE_BIT_RVS_WR_SHIFT)) & CRC_MODE_BIT_RVS_WR_MASK)
1158#define CRC_MODE_CMPL_WR_MASK (0x8U)
1159#define CRC_MODE_CMPL_WR_SHIFT (3U)
1160/*! CMPL_WR - Data complement: 1 = 1's complement for CRC_WR_DATA 0 = No 1's complement for CRC_WR_DATA
1161 */
1162#define CRC_MODE_CMPL_WR(x) (((uint32_t)(((uint32_t)(x)) << CRC_MODE_CMPL_WR_SHIFT)) & CRC_MODE_CMPL_WR_MASK)
1163#define CRC_MODE_BIT_RVS_SUM_MASK (0x10U)
1164#define CRC_MODE_BIT_RVS_SUM_SHIFT (4U)
1165/*! BIT_RVS_SUM - CRC sum bit order: 1 = Bit order reverse for CRC_SUM 0 = No bit order reverse for CRC_SUM
1166 */
1167#define CRC_MODE_BIT_RVS_SUM(x) (((uint32_t)(((uint32_t)(x)) << CRC_MODE_BIT_RVS_SUM_SHIFT)) & CRC_MODE_BIT_RVS_SUM_MASK)
1168#define CRC_MODE_CMPL_SUM_MASK (0x20U)
1169#define CRC_MODE_CMPL_SUM_SHIFT (5U)
1170/*! CMPL_SUM - CRC sum complement: 1 = 1's complement for CRC_SUM 0 = No 1's complement for CRC_SUM
1171 */
1172#define CRC_MODE_CMPL_SUM(x) (((uint32_t)(((uint32_t)(x)) << CRC_MODE_CMPL_SUM_SHIFT)) & CRC_MODE_CMPL_SUM_MASK)
1173/*! @} */
1174
1175/*! @name SEED - CRC seed register */
1176/*! @{ */
1177#define CRC_SEED_CRC_SEED_MASK (0xFFFFFFFFU)
1178#define CRC_SEED_CRC_SEED_SHIFT (0U)
1179/*! CRC_SEED - A write access to this register will load CRC seed value to CRC_SUM register with
1180 * selected bit order and 1's complement pre-processes. A write access to this register will
1181 * overrule the CRC calculation in progresses.
1182 */
1183#define CRC_SEED_CRC_SEED(x) (((uint32_t)(((uint32_t)(x)) << CRC_SEED_CRC_SEED_SHIFT)) & CRC_SEED_CRC_SEED_MASK)
1184/*! @} */
1185
1186/*! @name SUM - CRC checksum register */
1187/*! @{ */
1188#define CRC_SUM_CRC_SUM_MASK (0xFFFFFFFFU)
1189#define CRC_SUM_CRC_SUM_SHIFT (0U)
1190/*! CRC_SUM - The most recent CRC sum can be read through this register with selected bit order and 1's complement post-processes.
1191 */
1192#define CRC_SUM_CRC_SUM(x) (((uint32_t)(((uint32_t)(x)) << CRC_SUM_CRC_SUM_SHIFT)) & CRC_SUM_CRC_SUM_MASK)
1193/*! @} */
1194
1195/*! @name WR_DATA - CRC data register */
1196/*! @{ */
1197#define CRC_WR_DATA_CRC_WR_DATA_MASK (0xFFFFFFFFU)
1198#define CRC_WR_DATA_CRC_WR_DATA_SHIFT (0U)
1199/*! CRC_WR_DATA - Data written to this register will be taken to perform CRC calculation with
1200 * selected bit order and 1's complement pre-process. Any write size 8, 16 or 32-bit are allowed and
1201 * accept back-to-back transactions.
1202 */
1203#define CRC_WR_DATA_CRC_WR_DATA(x) (((uint32_t)(((uint32_t)(x)) << CRC_WR_DATA_CRC_WR_DATA_SHIFT)) & CRC_WR_DATA_CRC_WR_DATA_MASK)
1204/*! @} */
1205
1206
1207/*!
1208 * @}
1209 */ /* end of group CRC_Register_Masks */
1210
1211
1212/* CRC - Peripheral instance base addresses */
1213/** Peripheral CRC_ENGINE base address */
1214#define CRC_ENGINE_BASE (0x40095000u)
1215/** Peripheral CRC_ENGINE base pointer */
1216#define CRC_ENGINE ((CRC_Type *)CRC_ENGINE_BASE)
1217/** Array initializer of CRC peripheral base addresses */
1218#define CRC_BASE_ADDRS { CRC_ENGINE_BASE }
1219/** Array initializer of CRC peripheral base pointers */
1220#define CRC_BASE_PTRS { CRC_ENGINE }
1221
1222/*!
1223 * @}
1224 */ /* end of group CRC_Peripheral_Access_Layer */
1225
1226
1227/* ----------------------------------------------------------------------------
1228 -- CTIMER Peripheral Access Layer
1229 ---------------------------------------------------------------------------- */
1230
1231/*!
1232 * @addtogroup CTIMER_Peripheral_Access_Layer CTIMER Peripheral Access Layer
1233 * @{
1234 */
1235
1236/** CTIMER - Register Layout Typedef */
1237typedef struct {
1238 __IO uint32_t IR; /**< Interrupt Register. The IR can be written to clear interrupts. The IR can be read to identify which of eight possible interrupt sources are pending., offset: 0x0 */
1239 __IO uint32_t TCR; /**< Timer Control Register. The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR., offset: 0x4 */
1240 __IO uint32_t TC; /**< Timer Counter. The 32 bit TC is incremented every PR+1 cycles of the APB bus clock. The TC is controlled through the TCR., offset: 0x8 */
1241 __IO uint32_t PR; /**< Prescale Register. When the Prescale Counter (PC) is equal to this value, the next clock increments the TC and clears the PC., offset: 0xC */
1242 __IO uint32_t PC; /**< Prescale Counter. The 32 bit PC is a counter which is incremented to the value stored in PR. When the value in PR is reached, the TC is incremented and the PC is cleared. The PC is observable and controllable through the bus interface., offset: 0x10 */
1243 __IO uint32_t MCR; /**< Match Control Register. The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs., offset: 0x14 */
1244 __IO uint32_t MR[4]; /**< Match Register . MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC., array offset: 0x18, array step: 0x4 */
1245 __IO uint32_t CCR; /**< Capture Control Register. The CCR controls which edges of the capture inputs are used to load the Capture Registers and whether or not an interrupt is generated when a capture takes place., offset: 0x28 */
1246 __I uint32_t CR[4]; /**< Capture Register . CR is loaded with the value of TC when there is an event on the CAPn. input., array offset: 0x2C, array step: 0x4 */
1247 __IO uint32_t EMR; /**< External Match Register. The EMR controls the match function and the external match pins., offset: 0x3C */
1248 uint8_t RESERVED_0[48];
1249 __IO uint32_t CTCR; /**< Count Control Register. The CTCR selects between Timer and Counter mode, and in Counter mode selects the signal and edge(s) for counting., offset: 0x70 */
1250 __IO uint32_t PWMC; /**< PWM Control Register. The PWMCON enables PWM mode for the external match pins., offset: 0x74 */
1251} CTIMER_Type;
1252
1253/* ----------------------------------------------------------------------------
1254 -- CTIMER Register Masks
1255 ---------------------------------------------------------------------------- */
1256
1257/*!
1258 * @addtogroup CTIMER_Register_Masks CTIMER Register Masks
1259 * @{
1260 */
1261
1262/*! @name IR - Interrupt Register. The IR can be written to clear interrupts. The IR can be read to identify which of eight possible interrupt sources are pending. */
1263/*! @{ */
1264#define CTIMER_IR_MR0INT_MASK (0x1U)
1265#define CTIMER_IR_MR0INT_SHIFT (0U)
1266/*! MR0INT - Interrupt flag for match channel 0.
1267 */
1268#define CTIMER_IR_MR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR0INT_SHIFT)) & CTIMER_IR_MR0INT_MASK)
1269#define CTIMER_IR_MR1INT_MASK (0x2U)
1270#define CTIMER_IR_MR1INT_SHIFT (1U)
1271/*! MR1INT - Interrupt flag for match channel 1.
1272 */
1273#define CTIMER_IR_MR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR1INT_SHIFT)) & CTIMER_IR_MR1INT_MASK)
1274#define CTIMER_IR_MR2INT_MASK (0x4U)
1275#define CTIMER_IR_MR2INT_SHIFT (2U)
1276/*! MR2INT - Interrupt flag for match channel 2.
1277 */
1278#define CTIMER_IR_MR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR2INT_SHIFT)) & CTIMER_IR_MR2INT_MASK)
1279#define CTIMER_IR_MR3INT_MASK (0x8U)
1280#define CTIMER_IR_MR3INT_SHIFT (3U)
1281/*! MR3INT - Interrupt flag for match channel 3.
1282 */
1283#define CTIMER_IR_MR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR3INT_SHIFT)) & CTIMER_IR_MR3INT_MASK)
1284#define CTIMER_IR_CR0INT_MASK (0x10U)
1285#define CTIMER_IR_CR0INT_SHIFT (4U)
1286/*! CR0INT - Interrupt flag for capture channel 0 event.
1287 */
1288#define CTIMER_IR_CR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR0INT_SHIFT)) & CTIMER_IR_CR0INT_MASK)
1289#define CTIMER_IR_CR1INT_MASK (0x20U)
1290#define CTIMER_IR_CR1INT_SHIFT (5U)
1291/*! CR1INT - Interrupt flag for capture channel 1 event.
1292 */
1293#define CTIMER_IR_CR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR1INT_SHIFT)) & CTIMER_IR_CR1INT_MASK)
1294#define CTIMER_IR_CR2INT_MASK (0x40U)
1295#define CTIMER_IR_CR2INT_SHIFT (6U)
1296/*! CR2INT - Interrupt flag for capture channel 2 event.
1297 */
1298#define CTIMER_IR_CR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR2INT_SHIFT)) & CTIMER_IR_CR2INT_MASK)
1299#define CTIMER_IR_CR3INT_MASK (0x80U)
1300#define CTIMER_IR_CR3INT_SHIFT (7U)
1301/*! CR3INT - Interrupt flag for capture channel 3 event.
1302 */
1303#define CTIMER_IR_CR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR3INT_SHIFT)) & CTIMER_IR_CR3INT_MASK)
1304/*! @} */
1305
1306/*! @name TCR - Timer Control Register. The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR. */
1307/*! @{ */
1308#define CTIMER_TCR_CEN_MASK (0x1U)
1309#define CTIMER_TCR_CEN_SHIFT (0U)
1310/*! CEN - Counter enable.
1311 * 0b0..Disabled.The counters are disabled.
1312 * 0b1..Enabled. The Timer Counter and Prescale Counter are enabled.
1313 */
1314#define CTIMER_TCR_CEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CEN_SHIFT)) & CTIMER_TCR_CEN_MASK)
1315#define CTIMER_TCR_CRST_MASK (0x2U)
1316#define CTIMER_TCR_CRST_SHIFT (1U)
1317/*! CRST - Counter reset.
1318 * 0b0..Disabled. Do nothing.
1319 * 0b1..Enabled. The Timer Counter and the Prescale Counter are synchronously reset on the next positive edge of
1320 * the APB bus clock. The counters remain reset until TCR[1] is returned to zero.
1321 */
1322#define CTIMER_TCR_CRST(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CRST_SHIFT)) & CTIMER_TCR_CRST_MASK)
1323/*! @} */
1324
1325/*! @name TC - Timer Counter. The 32 bit TC is incremented every PR+1 cycles of the APB bus clock. The TC is controlled through the TCR. */
1326/*! @{ */
1327#define CTIMER_TC_TCVAL_MASK (0xFFFFFFFFU)
1328#define CTIMER_TC_TCVAL_SHIFT (0U)
1329/*! TCVAL - Timer counter value.
1330 */
1331#define CTIMER_TC_TCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TC_TCVAL_SHIFT)) & CTIMER_TC_TCVAL_MASK)
1332/*! @} */
1333
1334/*! @name PR - Prescale Register. When the Prescale Counter (PC) is equal to this value, the next clock increments the TC and clears the PC. */
1335/*! @{ */
1336#define CTIMER_PR_PRVAL_MASK (0xFFFFFFFFU)
1337#define CTIMER_PR_PRVAL_SHIFT (0U)
1338/*! PRVAL - Prescale counter value.
1339 */
1340#define CTIMER_PR_PRVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PR_PRVAL_SHIFT)) & CTIMER_PR_PRVAL_MASK)
1341/*! @} */
1342
1343/*! @name PC - Prescale Counter. The 32 bit PC is a counter which is incremented to the value stored in PR. When the value in PR is reached, the TC is incremented and the PC is cleared. The PC is observable and controllable through the bus interface. */
1344/*! @{ */
1345#define CTIMER_PC_PCVAL_MASK (0xFFFFFFFFU)
1346#define CTIMER_PC_PCVAL_SHIFT (0U)
1347/*! PCVAL - Prescale counter value.
1348 */
1349#define CTIMER_PC_PCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PC_PCVAL_SHIFT)) & CTIMER_PC_PCVAL_MASK)
1350/*! @} */
1351
1352/*! @name MCR - Match Control Register. The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs. */
1353/*! @{ */
1354#define CTIMER_MCR_MR0I_MASK (0x1U)
1355#define CTIMER_MCR_MR0I_SHIFT (0U)
1356/*! MR0I - Interrupt on MR0: an interrupt is generated when MR0 matches the value in the TC. 0 = disabled. 1 = enabled.
1357 */
1358#define CTIMER_MCR_MR0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0I_SHIFT)) & CTIMER_MCR_MR0I_MASK)
1359#define CTIMER_MCR_MR0R_MASK (0x2U)
1360#define CTIMER_MCR_MR0R_SHIFT (1U)
1361/*! MR0R - Reset on MR0: the TC will be reset if MR0 matches it. 0 = disabled. 1 = enabled.
1362 */
1363#define CTIMER_MCR_MR0R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0R_SHIFT)) & CTIMER_MCR_MR0R_MASK)
1364#define CTIMER_MCR_MR0S_MASK (0x4U)
1365#define CTIMER_MCR_MR0S_SHIFT (2U)
1366/*! MR0S - Stop on MR0: the TC and PC will be stopped and TCR[0] will be set to 0 if MR0 matches the TC. 0 = disabled. 1 = enabled.
1367 */
1368#define CTIMER_MCR_MR0S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0S_SHIFT)) & CTIMER_MCR_MR0S_MASK)
1369#define CTIMER_MCR_MR1I_MASK (0x8U)
1370#define CTIMER_MCR_MR1I_SHIFT (3U)
1371/*! MR1I - Interrupt on MR1: an interrupt is generated when MR1 matches the value in the TC. 0 =
1372 * disabled. 1 = enabled. 0 = disabled. 1 = enabled.
1373 */
1374#define CTIMER_MCR_MR1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1I_SHIFT)) & CTIMER_MCR_MR1I_MASK)
1375#define CTIMER_MCR_MR1R_MASK (0x10U)
1376#define CTIMER_MCR_MR1R_SHIFT (4U)
1377/*! MR1R - Reset on MR1: the TC will be reset if MR1 matches it. 0 = disabled. 1 = enabled.
1378 */
1379#define CTIMER_MCR_MR1R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1R_SHIFT)) & CTIMER_MCR_MR1R_MASK)
1380#define CTIMER_MCR_MR1S_MASK (0x20U)
1381#define CTIMER_MCR_MR1S_SHIFT (5U)
1382/*! MR1S - Stop on MR1: the TC and PC will be stopped and TCR[0] will be set to 0 if MR1 matches the TC. 0 = disabled. 1 = enabled.
1383 */
1384#define CTIMER_MCR_MR1S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1S_SHIFT)) & CTIMER_MCR_MR1S_MASK)
1385#define CTIMER_MCR_MR2I_MASK (0x40U)
1386#define CTIMER_MCR_MR2I_SHIFT (6U)
1387/*! MR2I - Interrupt on MR2: an interrupt is generated when MR2 matches the value in the TC. 0 = disabled. 1 = enabled.
1388 */
1389#define CTIMER_MCR_MR2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2I_SHIFT)) & CTIMER_MCR_MR2I_MASK)
1390#define CTIMER_MCR_MR2R_MASK (0x80U)
1391#define CTIMER_MCR_MR2R_SHIFT (7U)
1392/*! MR2R - Reset on MR2: the TC will be reset if MR2 matches it. 0 = disabled. 1 = enabled.
1393 */
1394#define CTIMER_MCR_MR2R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2R_SHIFT)) & CTIMER_MCR_MR2R_MASK)
1395#define CTIMER_MCR_MR2S_MASK (0x100U)
1396#define CTIMER_MCR_MR2S_SHIFT (8U)
1397/*! MR2S - Stop on MR2: the TC and PC will be stopped and TCR[0] will be set to 0 if MR2 matches the TC. 0 = disabled. 1 = enabled.
1398 */
1399#define CTIMER_MCR_MR2S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2S_SHIFT)) & CTIMER_MCR_MR2S_MASK)
1400#define CTIMER_MCR_MR3I_MASK (0x200U)
1401#define CTIMER_MCR_MR3I_SHIFT (9U)
1402/*! MR3I - Interrupt on MR3: an interrupt is generated when MR3 matches the value in the TC. 0 = disabled. 1 = enabled.
1403 */
1404#define CTIMER_MCR_MR3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3I_SHIFT)) & CTIMER_MCR_MR3I_MASK)
1405#define CTIMER_MCR_MR3R_MASK (0x400U)
1406#define CTIMER_MCR_MR3R_SHIFT (10U)
1407/*! MR3R - Reset on MR3: the TC will be reset if MR3 matches it. 0 = disabled. 1 = enabled.
1408 */
1409#define CTIMER_MCR_MR3R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3R_SHIFT)) & CTIMER_MCR_MR3R_MASK)
1410#define CTIMER_MCR_MR3S_MASK (0x800U)
1411#define CTIMER_MCR_MR3S_SHIFT (11U)
1412/*! MR3S - Stop on MR3: the TC and PC will be stopped and TCR[0] will be set to 0 if MR3 matches the TC. 0 = disabled. 1 = enabled.
1413 */
1414#define CTIMER_MCR_MR3S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3S_SHIFT)) & CTIMER_MCR_MR3S_MASK)
1415/*! @} */
1416
1417/*! @name MR - Match Register . MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC. */
1418/*! @{ */
1419#define CTIMER_MR_MATCH_MASK (0xFFFFFFFFU)
1420#define CTIMER_MR_MATCH_SHIFT (0U)
1421/*! MATCH - Timer counter match value.
1422 */
1423#define CTIMER_MR_MATCH(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MR_MATCH_SHIFT)) & CTIMER_MR_MATCH_MASK)
1424/*! @} */
1425
1426/* The count of CTIMER_MR */
1427#define CTIMER_MR_COUNT (4U)
1428
1429/*! @name CCR - Capture Control Register. The CCR controls which edges of the capture inputs are used to load the Capture Registers and whether or not an interrupt is generated when a capture takes place. */
1430/*! @{ */
1431#define CTIMER_CCR_CAP0RE_MASK (0x1U)
1432#define CTIMER_CCR_CAP0RE_SHIFT (0U)
1433/*! CAP0RE - Rising edge of capture channel 0: a sequence of 0 then 1 causes CR0 to be loaded with
1434 * the contents of TC. 0 = disabled. 1 = enabled.
1435 */
1436#define CTIMER_CCR_CAP0RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0RE_SHIFT)) & CTIMER_CCR_CAP0RE_MASK)
1437#define CTIMER_CCR_CAP0FE_MASK (0x2U)
1438#define CTIMER_CCR_CAP0FE_SHIFT (1U)
1439/*! CAP0FE - Falling edge of capture channel 0: a sequence of 1 then 0 causes CR0 to be loaded with
1440 * the contents of TC. 0 = disabled. 1 = enabled.
1441 */
1442#define CTIMER_CCR_CAP0FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0FE_SHIFT)) & CTIMER_CCR_CAP0FE_MASK)
1443#define CTIMER_CCR_CAP0I_MASK (0x4U)
1444#define CTIMER_CCR_CAP0I_SHIFT (2U)
1445/*! CAP0I - Generate interrupt on channel 0 capture event: a CR0 load generates an interrupt.
1446 */
1447#define CTIMER_CCR_CAP0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0I_SHIFT)) & CTIMER_CCR_CAP0I_MASK)
1448#define CTIMER_CCR_CAP1RE_MASK (0x8U)
1449#define CTIMER_CCR_CAP1RE_SHIFT (3U)
1450/*! CAP1RE - Rising edge of capture channel 1: a sequence of 0 then 1 causes CR1 to be loaded with
1451 * the contents of TC. 0 = disabled. 1 = enabled.
1452 */
1453#define CTIMER_CCR_CAP1RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1RE_SHIFT)) & CTIMER_CCR_CAP1RE_MASK)
1454#define CTIMER_CCR_CAP1FE_MASK (0x10U)
1455#define CTIMER_CCR_CAP1FE_SHIFT (4U)
1456/*! CAP1FE - Falling edge of capture channel 1: a sequence of 1 then 0 causes CR1 to be loaded with
1457 * the contents of TC. 0 = disabled. 1 = enabled.
1458 */
1459#define CTIMER_CCR_CAP1FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1FE_SHIFT)) & CTIMER_CCR_CAP1FE_MASK)
1460#define CTIMER_CCR_CAP1I_MASK (0x20U)
1461#define CTIMER_CCR_CAP1I_SHIFT (5U)
1462/*! CAP1I - Generate interrupt on channel 1 capture event: a CR1 load generates an interrupt.
1463 */
1464#define CTIMER_CCR_CAP1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1I_SHIFT)) & CTIMER_CCR_CAP1I_MASK)
1465#define CTIMER_CCR_CAP2RE_MASK (0x40U)
1466#define CTIMER_CCR_CAP2RE_SHIFT (6U)
1467/*! CAP2RE - Rising edge of capture channel 2: a sequence of 0 then 1 causes CR2 to be loaded with
1468 * the contents of TC. 0 = disabled. 1 = enabled.
1469 */
1470#define CTIMER_CCR_CAP2RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2RE_SHIFT)) & CTIMER_CCR_CAP2RE_MASK)
1471#define CTIMER_CCR_CAP2FE_MASK (0x80U)
1472#define CTIMER_CCR_CAP2FE_SHIFT (7U)
1473/*! CAP2FE - Falling edge of capture channel 2: a sequence of 1 then 0 causes CR2 to be loaded with
1474 * the contents of TC. 0 = disabled. 1 = enabled.
1475 */
1476#define CTIMER_CCR_CAP2FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2FE_SHIFT)) & CTIMER_CCR_CAP2FE_MASK)
1477#define CTIMER_CCR_CAP2I_MASK (0x100U)
1478#define CTIMER_CCR_CAP2I_SHIFT (8U)
1479/*! CAP2I - Generate interrupt on channel 2 capture event: a CR2 load generates an interrupt.
1480 */
1481#define CTIMER_CCR_CAP2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2I_SHIFT)) & CTIMER_CCR_CAP2I_MASK)
1482#define CTIMER_CCR_CAP3RE_MASK (0x200U)
1483#define CTIMER_CCR_CAP3RE_SHIFT (9U)
1484/*! CAP3RE - Rising edge of capture channel 3: a sequence of 0 then 1 causes CR3 to be loaded with
1485 * the contents of TC. 0 = disabled. 1 = enabled.
1486 */
1487#define CTIMER_CCR_CAP3RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3RE_SHIFT)) & CTIMER_CCR_CAP3RE_MASK)
1488#define CTIMER_CCR_CAP3FE_MASK (0x400U)
1489#define CTIMER_CCR_CAP3FE_SHIFT (10U)
1490/*! CAP3FE - Falling edge of capture channel 3: a sequence of 1 then 0 causes CR3 to be loaded with
1491 * the contents of TC. 0 = disabled. 1 = enabled.
1492 */
1493#define CTIMER_CCR_CAP3FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3FE_SHIFT)) & CTIMER_CCR_CAP3FE_MASK)
1494#define CTIMER_CCR_CAP3I_MASK (0x800U)
1495#define CTIMER_CCR_CAP3I_SHIFT (11U)
1496/*! CAP3I - Generate interrupt on channel 3 capture event: a CR3 load generates an interrupt.
1497 */
1498#define CTIMER_CCR_CAP3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3I_SHIFT)) & CTIMER_CCR_CAP3I_MASK)
1499/*! @} */
1500
1501/*! @name CR - Capture Register . CR is loaded with the value of TC when there is an event on the CAPn. input. */
1502/*! @{ */
1503#define CTIMER_CR_CAP_MASK (0xFFFFFFFFU)
1504#define CTIMER_CR_CAP_SHIFT (0U)
1505/*! CAP - Timer counter capture value.
1506 */
1507#define CTIMER_CR_CAP(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CR_CAP_SHIFT)) & CTIMER_CR_CAP_MASK)
1508/*! @} */
1509
1510/* The count of CTIMER_CR */
1511#define CTIMER_CR_COUNT (4U)
1512
1513/*! @name EMR - External Match Register. The EMR controls the match function and the external match pins. */
1514/*! @{ */
1515#define CTIMER_EMR_EM0_MASK (0x1U)
1516#define CTIMER_EMR_EM0_SHIFT (0U)
1517/*! EM0 - External Match 0. This bit reflects the state of output MAT0, whether or not this output
1518 * is connected to a pin. When a match occurs between the TC and MR0, this bit can either toggle,
1519 * go LOW, go HIGH, or do nothing, as selected by EMR[5:4]. This bit is driven to the MAT pins if
1520 * the match function is selected via IOCON. 0 = LOW. 1 = HIGH.
1521 */
1522#define CTIMER_EMR_EM0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM0_SHIFT)) & CTIMER_EMR_EM0_MASK)
1523#define CTIMER_EMR_EM1_MASK (0x2U)
1524#define CTIMER_EMR_EM1_SHIFT (1U)
1525/*! EM1 - External Match 1. This bit reflects the state of output MAT1, whether or not this output
1526 * is connected to a pin. When a match occurs between the TC and MR1, this bit can either toggle,
1527 * go LOW, go HIGH, or do nothing, as selected by EMR[7:6]. This bit is driven to the MAT pins if
1528 * the match function is selected via IOCON. 0 = LOW. 1 = HIGH.
1529 */
1530#define CTIMER_EMR_EM1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM1_SHIFT)) & CTIMER_EMR_EM1_MASK)
1531#define CTIMER_EMR_EM2_MASK (0x4U)
1532#define CTIMER_EMR_EM2_SHIFT (2U)
1533/*! EM2 - External Match 2. This bit reflects the state of output MAT2, whether or not this output
1534 * is connected to a pin. When a match occurs between the TC and MR2, this bit can either toggle,
1535 * go LOW, go HIGH, or do nothing, as selected by EMR[9:8]. This bit is driven to the MAT pins if
1536 * the match function is selected via IOCON. 0 = LOW. 1 = HIGH.
1537 */
1538#define CTIMER_EMR_EM2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM2_SHIFT)) & CTIMER_EMR_EM2_MASK)
1539#define CTIMER_EMR_EM3_MASK (0x8U)
1540#define CTIMER_EMR_EM3_SHIFT (3U)
1541/*! EM3 - External Match 3. This bit reflects the state of output MAT3, whether or not this output
1542 * is connected to a pin. When a match occurs between the TC and MR3, this bit can either toggle,
1543 * go LOW, go HIGH, or do nothing, as selected by MR[11:10]. This bit is driven to the MAT pins
1544 * if the match function is selected via IOCON. 0 = LOW. 1 = HIGH.
1545 */
1546#define CTIMER_EMR_EM3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM3_SHIFT)) & CTIMER_EMR_EM3_MASK)
1547#define CTIMER_EMR_EMC0_MASK (0x30U)
1548#define CTIMER_EMR_EMC0_SHIFT (4U)
1549/*! EMC0 - External Match Control 0. Determines the functionality of External Match 0.
1550 * 0b00..Do Nothing.
1551 * 0b01..Clear. Clear the corresponding External Match bit/output to 0 (MAT0 pin is LOW if pinned out).
1552 * 0b10..Set. Set the corresponding External Match bit/output to 1 (MAT0 pin is HIGH if pinned out).
1553 * 0b11..Toggle. Toggle the corresponding External Match bit/output.
1554 */
1555#define CTIMER_EMR_EMC0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC0_SHIFT)) & CTIMER_EMR_EMC0_MASK)
1556#define CTIMER_EMR_EMC1_MASK (0xC0U)
1557#define CTIMER_EMR_EMC1_SHIFT (6U)
1558/*! EMC1 - External Match Control 1. Determines the functionality of External Match 1.
1559 * 0b00..Do Nothing.
1560 * 0b01..Clear. Clear the corresponding External Match bit/output to 0 (MAT1 pin is LOW if pinned out).
1561 * 0b10..Set. Set the corresponding External Match bit/output to 1 (MAT1 pin is HIGH if pinned out).
1562 * 0b11..Toggle. Toggle the corresponding External Match bit/output.
1563 */
1564#define CTIMER_EMR_EMC1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC1_SHIFT)) & CTIMER_EMR_EMC1_MASK)
1565#define CTIMER_EMR_EMC2_MASK (0x300U)
1566#define CTIMER_EMR_EMC2_SHIFT (8U)
1567/*! EMC2 - External Match Control 2. Determines the functionality of External Match 2.
1568 * 0b00..Do Nothing.
1569 * 0b01..Clear. Clear the corresponding External Match bit/output to 0 (MAT2 pin is LOW if pinned out).
1570 * 0b10..Set. Set the corresponding External Match bit/output to 1 (MAT2 pin is HIGH if pinned out).
1571 * 0b11..Toggle. Toggle the corresponding External Match bit/output.
1572 */
1573#define CTIMER_EMR_EMC2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC2_SHIFT)) & CTIMER_EMR_EMC2_MASK)
1574#define CTIMER_EMR_EMC3_MASK (0xC00U)
1575#define CTIMER_EMR_EMC3_SHIFT (10U)
1576/*! EMC3 - External Match Control 3. Determines the functionality of External Match 3.
1577 * 0b00..Do Nothing.
1578 * 0b01..Clear. Clear the corresponding External Match bit/output to 0 (MAT3 pin is LOW if pinned out).
1579 * 0b10..Set. Set the corresponding External Match bit/output to 1 (MAT3 pin is HIGH if pinned out).
1580 * 0b11..Toggle. Toggle the corresponding External Match bit/output.
1581 */
1582#define CTIMER_EMR_EMC3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC3_SHIFT)) & CTIMER_EMR_EMC3_MASK)
1583/*! @} */
1584
1585/*! @name CTCR - Count Control Register. The CTCR selects between Timer and Counter mode, and in Counter mode selects the signal and edge(s) for counting. */
1586/*! @{ */
1587#define CTIMER_CTCR_CTMODE_MASK (0x3U)
1588#define CTIMER_CTCR_CTMODE_SHIFT (0U)
1589/*! CTMODE - Counter/Timer Mode This field selects which rising APB bus clock edges can increment
1590 * Timer's Prescale Counter (PC), or clear PC and increment Timer Counter (TC). Timer Mode: the TC
1591 * is incremented when the Prescale Counter matches the Prescale Register.
1592 * 0b00..Timer Mode. Incremented every rising APB bus clock edge.
1593 * 0b01..Counter Mode rising edge. TC is incremented on rising edges on the CAP input selected by bits 3:2.
1594 * 0b10..Counter Mode falling edge. TC is incremented on falling edges on the CAP input selected by bits 3:2.
1595 * 0b11..Counter Mode dual edge. TC is incremented on both edges on the CAP input selected by bits 3:2.
1596 */
1597#define CTIMER_CTCR_CTMODE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CTMODE_SHIFT)) & CTIMER_CTCR_CTMODE_MASK)
1598#define CTIMER_CTCR_CINSEL_MASK (0xCU)
1599#define CTIMER_CTCR_CINSEL_SHIFT (2U)
1600/*! CINSEL - Count Input Select When bits 1:0 in this register are not 00, these bits select which
1601 * CAP pin is sampled for clocking. Note: If Counter mode is selected for a particular CAPn input
1602 * in the CTCR, the 3 bits for that input in the Capture Control Register (CCR) must be
1603 * programmed as 000. However, capture and/or interrupt can be selected for the other 3 CAPn inputs in the
1604 * same timer.
1605 * 0b00..Channel 0. CAPn.0 for CTIMERn
1606 * 0b01..Channel 1. CAPn.1 for CTIMERn
1607 * 0b10..Channel 2. CAPn.2 for CTIMERn
1608 * 0b11..Channel 3. CAPn.3 for CTIMERn
1609 */
1610#define CTIMER_CTCR_CINSEL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CINSEL_SHIFT)) & CTIMER_CTCR_CINSEL_MASK)
1611#define CTIMER_CTCR_ENCC_MASK (0x10U)
1612#define CTIMER_CTCR_ENCC_SHIFT (4U)
1613/*! ENCC - Setting this bit to 1 enables clearing of the timer and the prescaler when the
1614 * capture-edge event specified in bits 7:5 occurs.
1615 */
1616#define CTIMER_CTCR_ENCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_ENCC_SHIFT)) & CTIMER_CTCR_ENCC_MASK)
1617#define CTIMER_CTCR_SELCC_MASK (0xE0U)
1618#define CTIMER_CTCR_SELCC_SHIFT (5U)
1619/*! SELCC - Edge select. When bit 4 is 1, these bits select which capture input edge will cause the
1620 * timer and prescaler to be cleared. These bits have no effect when bit 4 is low. Values 0x2 to
1621 * 0x3 and 0x6 to 0x7 are reserved.
1622 * 0b000..Channel 0 Rising Edge. Rising edge of the signal on capture channel 0 clears the timer (if bit 4 is set).
1623 * 0b001..Channel 0 Falling Edge. Falling edge of the signal on capture channel 0 clears the timer (if bit 4 is set).
1624 * 0b010..Channel 1 Rising Edge. Rising edge of the signal on capture channel 1 clears the timer (if bit 4 is set).
1625 * 0b011..Channel 1 Falling Edge. Falling edge of the signal on capture channel 1 clears the timer (if bit 4 is set).
1626 * 0b100..Channel 2 Rising Edge. Rising edge of the signal on capture channel 2 clears the timer (if bit 4 is set).
1627 * 0b101..Channel 2 Falling Edge. Falling edge of the signal on capture channel 2 clears the timer (if bit 4 is set).
1628 */
1629#define CTIMER_CTCR_SELCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_SELCC_SHIFT)) & CTIMER_CTCR_SELCC_MASK)
1630/*! @} */
1631
1632/*! @name PWMC - PWM Control Register. The PWMCON enables PWM mode for the external match pins. */
1633/*! @{ */
1634#define CTIMER_PWMC_PWMEN0_MASK (0x1U)
1635#define CTIMER_PWMC_PWMEN0_SHIFT (0U)
1636/*! PWMEN0 - PWM mode enable for channel0.
1637 * 0b0..Match. CTIMERn_MAT0 is controlled by EM0.
1638 * 0b1..PWM. PWM mode is enabled for CTIMERn_MAT0.
1639 */
1640#define CTIMER_PWMC_PWMEN0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN0_SHIFT)) & CTIMER_PWMC_PWMEN0_MASK)
1641#define CTIMER_PWMC_PWMEN1_MASK (0x2U)
1642#define CTIMER_PWMC_PWMEN1_SHIFT (1U)
1643/*! PWMEN1 - PWM mode enable for channel1.
1644 * 0b0..Match. CTIMERn_MAT01 is controlled by EM1.
1645 * 0b1..PWM. PWM mode is enabled for CTIMERn_MAT1.
1646 */
1647#define CTIMER_PWMC_PWMEN1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN1_SHIFT)) & CTIMER_PWMC_PWMEN1_MASK)
1648#define CTIMER_PWMC_PWMEN2_MASK (0x4U)
1649#define CTIMER_PWMC_PWMEN2_SHIFT (2U)
1650/*! PWMEN2 - PWM mode enable for channel2.
1651 * 0b0..Match. CTIMERn_MAT2 is controlled by EM2.
1652 * 0b1..PWM. PWM mode is enabled for CTIMERn_MAT2.
1653 */
1654#define CTIMER_PWMC_PWMEN2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN2_SHIFT)) & CTIMER_PWMC_PWMEN2_MASK)
1655#define CTIMER_PWMC_PWMEN3_MASK (0x8U)
1656#define CTIMER_PWMC_PWMEN3_SHIFT (3U)
1657/*! PWMEN3 - PWM mode enable for channel3. Note: It is recommended to use match channel 3 to set the PWM cycle.
1658 * 0b0..Match. CTIMERn_MAT3 is controlled by EM3.
1659 * 0b1..PWM. PWM mode is enabled for CT132Bn_MAT3.
1660 */
1661#define CTIMER_PWMC_PWMEN3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN3_SHIFT)) & CTIMER_PWMC_PWMEN3_MASK)
1662/*! @} */
1663
1664
1665/*!
1666 * @}
1667 */ /* end of group CTIMER_Register_Masks */
1668
1669
1670/* CTIMER - Peripheral instance base addresses */
1671/** Peripheral CTIMER0 base address */
1672#define CTIMER0_BASE (0x40008000u)
1673/** Peripheral CTIMER0 base pointer */
1674#define CTIMER0 ((CTIMER_Type *)CTIMER0_BASE)
1675/** Peripheral CTIMER1 base address */
1676#define CTIMER1_BASE (0x40009000u)
1677/** Peripheral CTIMER1 base pointer */
1678#define CTIMER1 ((CTIMER_Type *)CTIMER1_BASE)
1679/** Peripheral CTIMER2 base address */
1680#define CTIMER2_BASE (0x40028000u)
1681/** Peripheral CTIMER2 base pointer */
1682#define CTIMER2 ((CTIMER_Type *)CTIMER2_BASE)
1683/** Peripheral CTIMER3 base address */
1684#define CTIMER3_BASE (0x40048000u)
1685/** Peripheral CTIMER3 base pointer */
1686#define CTIMER3 ((CTIMER_Type *)CTIMER3_BASE)
1687/** Peripheral CTIMER4 base address */
1688#define CTIMER4_BASE (0x40049000u)
1689/** Peripheral CTIMER4 base pointer */
1690#define CTIMER4 ((CTIMER_Type *)CTIMER4_BASE)
1691/** Array initializer of CTIMER peripheral base addresses */
1692#define CTIMER_BASE_ADDRS { CTIMER0_BASE, CTIMER1_BASE, CTIMER2_BASE, CTIMER3_BASE, CTIMER4_BASE }
1693/** Array initializer of CTIMER peripheral base pointers */
1694#define CTIMER_BASE_PTRS { CTIMER0, CTIMER1, CTIMER2, CTIMER3, CTIMER4 }
1695/** Interrupt vectors for the CTIMER peripheral type */
1696#define CTIMER_IRQS { CTIMER0_IRQn, CTIMER1_IRQn, NotAvail_IRQn, CTIMER3_IRQn, NotAvail_IRQn }
1697
1698/*!
1699 * @}
1700 */ /* end of group CTIMER_Peripheral_Access_Layer */
1701
1702
1703/* ----------------------------------------------------------------------------
1704 -- DMA Peripheral Access Layer
1705 ---------------------------------------------------------------------------- */
1706
1707/*!
1708 * @addtogroup DMA_Peripheral_Access_Layer DMA Peripheral Access Layer
1709 * @{
1710 */
1711
1712/** DMA - Register Layout Typedef */
1713typedef struct {
1714 __IO uint32_t CTRL; /**< DMA control., offset: 0x0 */
1715 __I uint32_t INTSTAT; /**< Interrupt status., offset: 0x4 */
1716 __IO uint32_t SRAMBASE; /**< SRAM address of the channel configuration table., offset: 0x8 */
1717 uint8_t RESERVED_0[20];
1718 struct { /* offset: 0x20, array step: 0x5C */
1719 __IO uint32_t ENABLESET; /**< Channel Enable read and Set for all DMA channels., array offset: 0x20, array step: 0x5C */
1720 uint8_t RESERVED_0[4];
1721 __O uint32_t ENABLECLR; /**< Channel Enable Clear for all DMA channels., array offset: 0x28, array step: 0x5C */
1722 uint8_t RESERVED_1[4];
1723 __I uint32_t ACTIVE; /**< Channel Active status for all DMA channels., array offset: 0x30, array step: 0x5C */
1724 uint8_t RESERVED_2[4];
1725 __I uint32_t BUSY; /**< Channel Busy status for all DMA channels., array offset: 0x38, array step: 0x5C */
1726 uint8_t RESERVED_3[4];
1727 __IO uint32_t ERRINT; /**< Error Interrupt status for all DMA channels., array offset: 0x40, array step: 0x5C */
1728 uint8_t RESERVED_4[4];
1729 __IO uint32_t INTENSET; /**< Interrupt Enable read and Set for all DMA channels., array offset: 0x48, array step: 0x5C */
1730 uint8_t RESERVED_5[4];
1731 __O uint32_t INTENCLR; /**< Interrupt Enable Clear for all DMA channels., array offset: 0x50, array step: 0x5C */
1732 uint8_t RESERVED_6[4];
1733 __IO uint32_t INTA; /**< Interrupt A status for all DMA channels., array offset: 0x58, array step: 0x5C */
1734 uint8_t RESERVED_7[4];
1735 __IO uint32_t INTB; /**< Interrupt B status for all DMA channels., array offset: 0x60, array step: 0x5C */
1736 uint8_t RESERVED_8[4];
1737 __O uint32_t SETVALID; /**< Set ValidPending control bits for all DMA channels., array offset: 0x68, array step: 0x5C */
1738 uint8_t RESERVED_9[4];
1739 __O uint32_t SETTRIG; /**< Set Trigger control bits for all DMA channels., array offset: 0x70, array step: 0x5C */
1740 uint8_t RESERVED_10[4];
1741 __O uint32_t ABORT; /**< Channel Abort control for all DMA channels., array offset: 0x78, array step: 0x5C */
1742 } COMMON[1];
1743 uint8_t RESERVED_1[900];
1744 struct { /* offset: 0x400, array step: 0x10 */
1745 __IO uint32_t CFG; /**< Configuration register for DMA channel ., array offset: 0x400, array step: 0x10 */
1746 __I uint32_t CTLSTAT; /**< Control and status register for DMA channel ., array offset: 0x404, array step: 0x10 */
1747 __IO uint32_t XFERCFG; /**< Transfer configuration register for DMA channel ., array offset: 0x408, array step: 0x10 */
1748 uint8_t RESERVED_0[4];
1749 } CHANNEL[20];
1750} DMA_Type;
1751
1752/* ----------------------------------------------------------------------------
1753 -- DMA Register Masks
1754 ---------------------------------------------------------------------------- */
1755
1756/*!
1757 * @addtogroup DMA_Register_Masks DMA Register Masks
1758 * @{
1759 */
1760
1761/*! @name CTRL - DMA control. */
1762/*! @{ */
1763#define DMA_CTRL_ENABLE_MASK (0x1U)
1764#define DMA_CTRL_ENABLE_SHIFT (0U)
1765/*! ENABLE - DMA controller master enable.
1766 * 0b0..Disabled. The DMA controller is disabled. This clears any triggers that were asserted at the point when
1767 * disabled, but does not prevent re-triggering when the DMA controller is re-enabled.
1768 * 0b1..Enabled. The DMA controller is enabled.
1769 */
1770#define DMA_CTRL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CTRL_ENABLE_SHIFT)) & DMA_CTRL_ENABLE_MASK)
1771/*! @} */
1772
1773/*! @name INTSTAT - Interrupt status. */
1774/*! @{ */
1775#define DMA_INTSTAT_ACTIVEINT_MASK (0x2U)
1776#define DMA_INTSTAT_ACTIVEINT_SHIFT (1U)
1777/*! ACTIVEINT - Summarizes whether any enabled interrupts (other than error interrupts) are pending.
1778 * 0b0..Not pending. No enabled interrupts are pending.
1779 * 0b1..Pending. At least one enabled interrupt is pending.
1780 */
1781#define DMA_INTSTAT_ACTIVEINT(x) (((uint32_t)(((uint32_t)(x)) << DMA_INTSTAT_ACTIVEINT_SHIFT)) & DMA_INTSTAT_ACTIVEINT_MASK)
1782#define DMA_INTSTAT_ACTIVEERRINT_MASK (0x4U)
1783#define DMA_INTSTAT_ACTIVEERRINT_SHIFT (2U)
1784/*! ACTIVEERRINT - Summarizes whether any error interrupts are pending.
1785 * 0b0..Not pending. No error interrupts are pending.
1786 * 0b1..Pending. At least one error interrupt is pending.
1787 */
1788#define DMA_INTSTAT_ACTIVEERRINT(x) (((uint32_t)(((uint32_t)(x)) << DMA_INTSTAT_ACTIVEERRINT_SHIFT)) & DMA_INTSTAT_ACTIVEERRINT_MASK)
1789/*! @} */
1790
1791/*! @name SRAMBASE - SRAM address of the channel configuration table. */
1792/*! @{ */
1793#define DMA_SRAMBASE_OFFSET_MASK (0xFFFFFE00U)
1794#define DMA_SRAMBASE_OFFSET_SHIFT (9U)
1795/*! OFFSET - Address bits 31:9 of the beginning of the DMA descriptor table. For 18 channels, the
1796 * table must begin on a 512 byte boundary.
1797 */
1798#define DMA_SRAMBASE_OFFSET(x) (((uint32_t)(((uint32_t)(x)) << DMA_SRAMBASE_OFFSET_SHIFT)) & DMA_SRAMBASE_OFFSET_MASK)
1799/*! @} */
1800
1801/*! @name COMMON_ENABLESET - Channel Enable read and Set for all DMA channels. */
1802/*! @{ */
1803#define DMA_COMMON_ENABLESET_ENA_MASK (0xFFFFFFFFU)
1804#define DMA_COMMON_ENABLESET_ENA_SHIFT (0U)
1805/*! ENA - Enable for DMA channels. Bit n enables or disables DMA channel n. The number of bits =
1806 * number of DMA channels in this device. Other bits are reserved. 0 = disabled. 1 = enabled.
1807 */
1808#define DMA_COMMON_ENABLESET_ENA(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_ENABLESET_ENA_SHIFT)) & DMA_COMMON_ENABLESET_ENA_MASK)
1809/*! @} */
1810
1811/* The count of DMA_COMMON_ENABLESET */
1812#define DMA_COMMON_ENABLESET_COUNT (1U)
1813
1814/*! @name COMMON_ENABLECLR - Channel Enable Clear for all DMA channels. */
1815/*! @{ */
1816#define DMA_COMMON_ENABLECLR_CLR_MASK (0xFFFFFFFFU)
1817#define DMA_COMMON_ENABLECLR_CLR_SHIFT (0U)
1818/*! CLR - Writing ones to this register clears the corresponding bits in ENABLESET0. Bit n clears
1819 * the channel enable bit n. The number of bits = number of DMA channels in this device. Other bits
1820 * are reserved.
1821 */
1822#define DMA_COMMON_ENABLECLR_CLR(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_ENABLECLR_CLR_SHIFT)) & DMA_COMMON_ENABLECLR_CLR_MASK)
1823/*! @} */
1824
1825/* The count of DMA_COMMON_ENABLECLR */
1826#define DMA_COMMON_ENABLECLR_COUNT (1U)
1827
1828/*! @name COMMON_ACTIVE - Channel Active status for all DMA channels. */
1829/*! @{ */
1830#define DMA_COMMON_ACTIVE_ACT_MASK (0xFFFFFFFFU)
1831#define DMA_COMMON_ACTIVE_ACT_SHIFT (0U)
1832/*! ACT - Active flag for DMA channel n. Bit n corresponds to DMA channel n. The number of bits =
1833 * number of DMA channels in this device. Other bits are reserved. 0 = not active. 1 = active.
1834 */
1835#define DMA_COMMON_ACTIVE_ACT(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_ACTIVE_ACT_SHIFT)) & DMA_COMMON_ACTIVE_ACT_MASK)
1836/*! @} */
1837
1838/* The count of DMA_COMMON_ACTIVE */
1839#define DMA_COMMON_ACTIVE_COUNT (1U)
1840
1841/*! @name COMMON_BUSY - Channel Busy status for all DMA channels. */
1842/*! @{ */
1843#define DMA_COMMON_BUSY_BSY_MASK (0xFFFFFFFFU)
1844#define DMA_COMMON_BUSY_BSY_SHIFT (0U)
1845/*! BSY - Busy flag for DMA channel n. Bit n corresponds to DMA channel n. The number of bits =
1846 * number of DMA channels in this device. Other bits are reserved. 0 = not busy. 1 = busy.
1847 */
1848#define DMA_COMMON_BUSY_BSY(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_BUSY_BSY_SHIFT)) & DMA_COMMON_BUSY_BSY_MASK)
1849/*! @} */
1850
1851/* The count of DMA_COMMON_BUSY */
1852#define DMA_COMMON_BUSY_COUNT (1U)
1853
1854/*! @name COMMON_ERRINT - Error Interrupt status for all DMA channels. */
1855/*! @{ */
1856#define DMA_COMMON_ERRINT_ERR_MASK (0xFFFFFFFFU)
1857#define DMA_COMMON_ERRINT_ERR_SHIFT (0U)
1858/*! ERR - Error Interrupt flag for DMA channel n. Bit n corresponds to DMA channel n. The number of
1859 * bits = number of DMA channels in this device. Other bits are reserved. 0 = error interrupt is
1860 * not active. 1 = error interrupt is active.
1861 */
1862#define DMA_COMMON_ERRINT_ERR(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_ERRINT_ERR_SHIFT)) & DMA_COMMON_ERRINT_ERR_MASK)
1863/*! @} */
1864
1865/* The count of DMA_COMMON_ERRINT */
1866#define DMA_COMMON_ERRINT_COUNT (1U)
1867
1868/*! @name COMMON_INTENSET - Interrupt Enable read and Set for all DMA channels. */
1869/*! @{ */
1870#define DMA_COMMON_INTENSET_INTEN_MASK (0xFFFFFFFFU)
1871#define DMA_COMMON_INTENSET_INTEN_SHIFT (0U)
1872/*! INTEN - Interrupt Enable read and set for DMA channel n. Bit n corresponds to DMA channel n. The
1873 * number of bits = number of DMA channels in this device. Other bits are reserved. 0 =
1874 * interrupt for DMA channel is disabled. 1 = interrupt for DMA channel is enabled.
1875 */
1876#define DMA_COMMON_INTENSET_INTEN(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_INTENSET_INTEN_SHIFT)) & DMA_COMMON_INTENSET_INTEN_MASK)
1877/*! @} */
1878
1879/* The count of DMA_COMMON_INTENSET */
1880#define DMA_COMMON_INTENSET_COUNT (1U)
1881
1882/*! @name COMMON_INTENCLR - Interrupt Enable Clear for all DMA channels. */
1883/*! @{ */
1884#define DMA_COMMON_INTENCLR_CLR_MASK (0xFFFFFFFFU)
1885#define DMA_COMMON_INTENCLR_CLR_SHIFT (0U)
1886/*! CLR - Writing ones to this register clears corresponding bits in the INTENSET0. Bit n
1887 * corresponds to DMA channel n. The number of bits = number of DMA channels in this device. Other bits are
1888 * reserved.
1889 */
1890#define DMA_COMMON_INTENCLR_CLR(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_INTENCLR_CLR_SHIFT)) & DMA_COMMON_INTENCLR_CLR_MASK)
1891/*! @} */
1892
1893/* The count of DMA_COMMON_INTENCLR */
1894#define DMA_COMMON_INTENCLR_COUNT (1U)
1895
1896/*! @name COMMON_INTA - Interrupt A status for all DMA channels. */
1897/*! @{ */
1898#define DMA_COMMON_INTA_IA_MASK (0xFFFFFFFFU)
1899#define DMA_COMMON_INTA_IA_SHIFT (0U)
1900/*! IA - Interrupt A status for DMA channel n. Bit n corresponds to DMA channel n. The number of
1901 * bits = number of DMA channels in this device. Other bits are reserved. 0 = the DMA channel
1902 * interrupt A is not active. 1 = the DMA channel interrupt A is active.
1903 */
1904#define DMA_COMMON_INTA_IA(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_INTA_IA_SHIFT)) & DMA_COMMON_INTA_IA_MASK)
1905/*! @} */
1906
1907/* The count of DMA_COMMON_INTA */
1908#define DMA_COMMON_INTA_COUNT (1U)
1909
1910/*! @name COMMON_INTB - Interrupt B status for all DMA channels. */
1911/*! @{ */
1912#define DMA_COMMON_INTB_IB_MASK (0xFFFFFFFFU)
1913#define DMA_COMMON_INTB_IB_SHIFT (0U)
1914/*! IB - Interrupt B status for DMA channel n. Bit n corresponds to DMA channel n. The number of
1915 * bits = number of DMA channels in this device. Other bits are reserved. 0 = the DMA channel
1916 * interrupt B is not active. 1 = the DMA channel interrupt B is active.
1917 */
1918#define DMA_COMMON_INTB_IB(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_INTB_IB_SHIFT)) & DMA_COMMON_INTB_IB_MASK)
1919/*! @} */
1920
1921/* The count of DMA_COMMON_INTB */
1922#define DMA_COMMON_INTB_COUNT (1U)
1923
1924/*! @name COMMON_SETVALID - Set ValidPending control bits for all DMA channels. */
1925/*! @{ */
1926#define DMA_COMMON_SETVALID_SV_MASK (0xFFFFFFFFU)
1927#define DMA_COMMON_SETVALID_SV_SHIFT (0U)
1928/*! SV - SETVALID control for DMA channel n. Bit n corresponds to DMA channel n. The number of bits
1929 * = number of DMA channels in this device. Other bits are reserved. 0 = no effect. 1 = sets the
1930 * VALIDPENDING control bit for DMA channel n
1931 */
1932#define DMA_COMMON_SETVALID_SV(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_SETVALID_SV_SHIFT)) & DMA_COMMON_SETVALID_SV_MASK)
1933/*! @} */
1934
1935/* The count of DMA_COMMON_SETVALID */
1936#define DMA_COMMON_SETVALID_COUNT (1U)
1937
1938/*! @name COMMON_SETTRIG - Set Trigger control bits for all DMA channels. */
1939/*! @{ */
1940#define DMA_COMMON_SETTRIG_TRIG_MASK (0xFFFFFFFFU)
1941#define DMA_COMMON_SETTRIG_TRIG_SHIFT (0U)
1942/*! TRIG - Set Trigger control bit for DMA channel 0. Bit n corresponds to DMA channel n. The number
1943 * of bits = number of DMA channels in this device. Other bits are reserved. 0 = no effect. 1 =
1944 * sets the TRIG bit for DMA channel n.
1945 */
1946#define DMA_COMMON_SETTRIG_TRIG(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_SETTRIG_TRIG_SHIFT)) & DMA_COMMON_SETTRIG_TRIG_MASK)
1947/*! @} */
1948
1949/* The count of DMA_COMMON_SETTRIG */
1950#define DMA_COMMON_SETTRIG_COUNT (1U)
1951
1952/*! @name COMMON_ABORT - Channel Abort control for all DMA channels. */
1953/*! @{ */
1954#define DMA_COMMON_ABORT_ABORTCTRL_MASK (0xFFFFFFFFU)
1955#define DMA_COMMON_ABORT_ABORTCTRL_SHIFT (0U)
1956/*! ABORTCTRL - Abort control for DMA channel 0. Bit n corresponds to DMA channel n. 0 = no effect.
1957 * 1 = aborts DMA operations on channel n.
1958 */
1959#define DMA_COMMON_ABORT_ABORTCTRL(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_ABORT_ABORTCTRL_SHIFT)) & DMA_COMMON_ABORT_ABORTCTRL_MASK)
1960/*! @} */
1961
1962/* The count of DMA_COMMON_ABORT */
1963#define DMA_COMMON_ABORT_COUNT (1U)
1964
1965/*! @name CHANNEL_CFG - Configuration register for DMA channel . */
1966/*! @{ */
1967#define DMA_CHANNEL_CFG_PERIPHREQEN_MASK (0x1U)
1968#define DMA_CHANNEL_CFG_PERIPHREQEN_SHIFT (0U)
1969/*! PERIPHREQEN - Peripheral request Enable. If a DMA channel is used to perform a memory-to-memory
1970 * move, any peripheral DMA request associated with that channel can be disabled to prevent any
1971 * interaction between the peripheral and the DMA controller.
1972 * 0b0..Disabled. Peripheral DMA requests are disabled.
1973 * 0b1..Enabled. Peripheral DMA requests are enabled.
1974 */
1975#define DMA_CHANNEL_CFG_PERIPHREQEN(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_PERIPHREQEN_SHIFT)) & DMA_CHANNEL_CFG_PERIPHREQEN_MASK)
1976#define DMA_CHANNEL_CFG_HWTRIGEN_MASK (0x2U)
1977#define DMA_CHANNEL_CFG_HWTRIGEN_SHIFT (1U)
1978/*! HWTRIGEN - Hardware Triggering Enable for this channel.
1979 * 0b0..Disabled. Hardware triggering is not used.
1980 * 0b1..Enabled. Use hardware triggering.
1981 */
1982#define DMA_CHANNEL_CFG_HWTRIGEN(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_HWTRIGEN_SHIFT)) & DMA_CHANNEL_CFG_HWTRIGEN_MASK)
1983#define DMA_CHANNEL_CFG_TRIGPOL_MASK (0x10U)
1984#define DMA_CHANNEL_CFG_TRIGPOL_SHIFT (4U)
1985/*! TRIGPOL - Trigger Polarity. Selects the polarity of a hardware trigger for this channel.
1986 * 0b0..Active low - falling edge. Hardware trigger is active low or falling edge triggered, based on TRIGTYPE.
1987 * 0b1..Active high - rising edge. Hardware trigger is active high or rising edge triggered, based on TRIGTYPE.
1988 */
1989#define DMA_CHANNEL_CFG_TRIGPOL(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_TRIGPOL_SHIFT)) & DMA_CHANNEL_CFG_TRIGPOL_MASK)
1990#define DMA_CHANNEL_CFG_TRIGTYPE_MASK (0x20U)
1991#define DMA_CHANNEL_CFG_TRIGTYPE_SHIFT (5U)
1992/*! TRIGTYPE - Trigger Type. Selects hardware trigger as edge triggered or level triggered.
1993 * 0b0..Edge. Hardware trigger is edge triggered. Transfers will be initiated and completed, as specified for a single trigger.
1994 * 0b1..Level. Hardware trigger is level triggered. Note that when level triggering without burst (BURSTPOWER =
1995 * 0) is selected, only hardware triggers should be used on that channel. Transfers continue as long as the
1996 * trigger level is asserted. Once the trigger is de-asserted, the transfer will be paused until the trigger
1997 * is, again, asserted. However, the transfer will not be paused until any remaining transfers within the
1998 * current BURSTPOWER length are completed.
1999 */
2000#define DMA_CHANNEL_CFG_TRIGTYPE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_TRIGTYPE_SHIFT)) & DMA_CHANNEL_CFG_TRIGTYPE_MASK)
2001#define DMA_CHANNEL_CFG_TRIGBURST_MASK (0x40U)
2002#define DMA_CHANNEL_CFG_TRIGBURST_SHIFT (6U)
2003/*! TRIGBURST - Trigger Burst. Selects whether hardware triggers cause a single or burst transfer.
2004 * 0b0..Single transfer. Hardware trigger causes a single transfer.
2005 * 0b1..Burst transfer. When the trigger for this channel is set to edge triggered, a hardware trigger causes a
2006 * burst transfer, as defined by BURSTPOWER. When the trigger for this channel is set to level triggered, a
2007 * hardware trigger causes transfers to continue as long as the trigger is asserted, unless the transfer is
2008 * complete.
2009 */
2010#define DMA_CHANNEL_CFG_TRIGBURST(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_TRIGBURST_SHIFT)) & DMA_CHANNEL_CFG_TRIGBURST_MASK)
2011#define DMA_CHANNEL_CFG_BURSTPOWER_MASK (0xF00U)
2012#define DMA_CHANNEL_CFG_BURSTPOWER_SHIFT (8U)
2013/*! BURSTPOWER - Burst Power is used in two ways. It always selects the address wrap size when
2014 * SRCBURSTWRAP and/or DSTBURSTWRAP modes are selected (see descriptions elsewhere in this register).
2015 * When the TRIGBURST field elsewhere in this register = 1, Burst Power selects how many
2016 * transfers are performed for each DMA trigger. This can be used, for example, with peripherals that
2017 * contain a FIFO that can initiate a DMA operation when the FIFO reaches a certain level. 0000:
2018 * Burst size = 1 (20). 0001: Burst size = 2 (21). 0010: Burst size = 4 (22). 1010: Burst size =
2019 * 1024 (210). This corresponds to the maximum supported transfer count. others: not supported. The
2020 * total transfer length as defined in the XFERCOUNT bits in the XFERCFG register must be an even
2021 * multiple of the burst size.
2022 */
2023#define DMA_CHANNEL_CFG_BURSTPOWER(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_BURSTPOWER_SHIFT)) & DMA_CHANNEL_CFG_BURSTPOWER_MASK)
2024#define DMA_CHANNEL_CFG_SRCBURSTWRAP_MASK (0x4000U)
2025#define DMA_CHANNEL_CFG_SRCBURSTWRAP_SHIFT (14U)
2026/*! SRCBURSTWRAP - Source Burst Wrap. When enabled, the source data address for the DMA is
2027 * 'wrapped', meaning that the source address range for each burst will be the same. As an example, this
2028 * could be used to read several sequential registers from a peripheral for each DMA burst,
2029 * reading the same registers again for each burst.
2030 * 0b0..Disabled. Source burst wrapping is not enabled for this DMA channel.
2031 * 0b1..Enabled. Source burst wrapping is enabled for this DMA channel.
2032 */
2033#define DMA_CHANNEL_CFG_SRCBURSTWRAP(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_SRCBURSTWRAP_SHIFT)) & DMA_CHANNEL_CFG_SRCBURSTWRAP_MASK)
2034#define DMA_CHANNEL_CFG_DSTBURSTWRAP_MASK (0x8000U)
2035#define DMA_CHANNEL_CFG_DSTBURSTWRAP_SHIFT (15U)
2036/*! DSTBURSTWRAP - Destination Burst Wrap. When enabled, the destination data address for the DMA is
2037 * 'wrapped', meaning that the destination address range for each burst will be the same. As an
2038 * example, this could be used to write several sequential registers to a peripheral for each DMA
2039 * burst, writing the same registers again for each burst.
2040 * 0b0..Disabled. Destination burst wrapping is not enabled for this DMA channel.
2041 * 0b1..Enabled. Destination burst wrapping is enabled for this DMA channel.
2042 */
2043#define DMA_CHANNEL_CFG_DSTBURSTWRAP(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_DSTBURSTWRAP_SHIFT)) & DMA_CHANNEL_CFG_DSTBURSTWRAP_MASK)
2044#define DMA_CHANNEL_CFG_CHPRIORITY_MASK (0x70000U)
2045#define DMA_CHANNEL_CFG_CHPRIORITY_SHIFT (16U)
2046/*! CHPRIORITY - Priority of this channel when multiple DMA requests are pending. Eight priority
2047 * levels are supported: 0x0 = highest priority. 0x7 = lowest priority.
2048 */
2049#define DMA_CHANNEL_CFG_CHPRIORITY(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_CHPRIORITY_SHIFT)) & DMA_CHANNEL_CFG_CHPRIORITY_MASK)
2050/*! @} */
2051
2052/* The count of DMA_CHANNEL_CFG */
2053#define DMA_CHANNEL_CFG_COUNT (20U)
2054
2055/*! @name CHANNEL_CTLSTAT - Control and status register for DMA channel . */
2056/*! @{ */
2057#define DMA_CHANNEL_CTLSTAT_VALIDPENDING_MASK (0x1U)
2058#define DMA_CHANNEL_CTLSTAT_VALIDPENDING_SHIFT (0U)
2059/*! VALIDPENDING - Valid pending flag for this channel. This bit is set when a 1 is written to the
2060 * corresponding bit in the related SETVALID register when CFGVALID = 1 for the same channel.
2061 * 0b0..No effect. No effect on DMA operation.
2062 * 0b1..Valid pending.
2063 */
2064#define DMA_CHANNEL_CTLSTAT_VALIDPENDING(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CTLSTAT_VALIDPENDING_SHIFT)) & DMA_CHANNEL_CTLSTAT_VALIDPENDING_MASK)
2065#define DMA_CHANNEL_CTLSTAT_TRIG_MASK (0x4U)
2066#define DMA_CHANNEL_CTLSTAT_TRIG_SHIFT (2U)
2067/*! TRIG - Trigger flag. Indicates that the trigger for this channel is currently set. This bit is
2068 * cleared at the end of an entire transfer or upon reload when CLRTRIG = 1.
2069 * 0b0..Not triggered. The trigger for this DMA channel is not set. DMA operations will not be carried out.
2070 * 0b1..Triggered. The trigger for this DMA channel is set. DMA operations will be carried out.
2071 */
2072#define DMA_CHANNEL_CTLSTAT_TRIG(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CTLSTAT_TRIG_SHIFT)) & DMA_CHANNEL_CTLSTAT_TRIG_MASK)
2073/*! @} */
2074
2075/* The count of DMA_CHANNEL_CTLSTAT */
2076#define DMA_CHANNEL_CTLSTAT_COUNT (20U)
2077
2078/*! @name CHANNEL_XFERCFG - Transfer configuration register for DMA channel . */
2079/*! @{ */
2080#define DMA_CHANNEL_XFERCFG_CFGVALID_MASK (0x1U)
2081#define DMA_CHANNEL_XFERCFG_CFGVALID_SHIFT (0U)
2082/*! CFGVALID - Configuration Valid flag. This bit indicates whether the current channel descriptor
2083 * is valid and can potentially be acted upon, if all other activation criteria are fulfilled.
2084 * 0b0..Not valid. The channel descriptor is not considered valid until validated by an associated SETVALID0 setting.
2085 * 0b1..Valid. The current channel descriptor is considered valid.
2086 */
2087#define DMA_CHANNEL_XFERCFG_CFGVALID(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_CFGVALID_SHIFT)) & DMA_CHANNEL_XFERCFG_CFGVALID_MASK)
2088#define DMA_CHANNEL_XFERCFG_RELOAD_MASK (0x2U)
2089#define DMA_CHANNEL_XFERCFG_RELOAD_SHIFT (1U)
2090/*! RELOAD - Indicates whether the channel's control structure will be reloaded when the current
2091 * descriptor is exhausted. Reloading allows ping-pong and linked transfers.
2092 * 0b0..Disabled. Do not reload the channels' control structure when the current descriptor is exhausted.
2093 * 0b1..Enabled. Reload the channels' control structure when the current descriptor is exhausted.
2094 */
2095#define DMA_CHANNEL_XFERCFG_RELOAD(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_RELOAD_SHIFT)) & DMA_CHANNEL_XFERCFG_RELOAD_MASK)
2096#define DMA_CHANNEL_XFERCFG_SWTRIG_MASK (0x4U)
2097#define DMA_CHANNEL_XFERCFG_SWTRIG_SHIFT (2U)
2098/*! SWTRIG - Software Trigger.
2099 * 0b0..Not set. When written by software, the trigger for this channel is not set. A new trigger, as defined by
2100 * the HWTRIGEN, TRIGPOL, and TRIGTYPE will be needed to start the channel.
2101 * 0b1..Set. When written by software, the trigger for this channel is set immediately. This feature should not
2102 * be used with level triggering when TRIGBURST = 0.
2103 */
2104#define DMA_CHANNEL_XFERCFG_SWTRIG(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_SWTRIG_SHIFT)) & DMA_CHANNEL_XFERCFG_SWTRIG_MASK)
2105#define DMA_CHANNEL_XFERCFG_CLRTRIG_MASK (0x8U)
2106#define DMA_CHANNEL_XFERCFG_CLRTRIG_SHIFT (3U)
2107/*! CLRTRIG - Clear Trigger.
2108 * 0b0..Not cleared. The trigger is not cleared when this descriptor is exhausted. If there is a reload, the next descriptor will be started.
2109 * 0b1..Cleared. The trigger is cleared when this descriptor is exhausted
2110 */
2111#define DMA_CHANNEL_XFERCFG_CLRTRIG(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_CLRTRIG_SHIFT)) & DMA_CHANNEL_XFERCFG_CLRTRIG_MASK)
2112#define DMA_CHANNEL_XFERCFG_SETINTA_MASK (0x10U)
2113#define DMA_CHANNEL_XFERCFG_SETINTA_SHIFT (4U)
2114/*! SETINTA - Set Interrupt flag A for this channel. There is no hardware distinction between
2115 * interrupt A and B. They can be used by software to assist with more complex descriptor usage. By
2116 * convention, interrupt A may be used when only one interrupt flag is needed.
2117 * 0b0..No effect.
2118 * 0b1..Set. The INTA flag for this channel will be set when the current descriptor is exhausted.
2119 */
2120#define DMA_CHANNEL_XFERCFG_SETINTA(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_SETINTA_SHIFT)) & DMA_CHANNEL_XFERCFG_SETINTA_MASK)
2121#define DMA_CHANNEL_XFERCFG_SETINTB_MASK (0x20U)
2122#define DMA_CHANNEL_XFERCFG_SETINTB_SHIFT (5U)
2123/*! SETINTB - Set Interrupt flag B for this channel. There is no hardware distinction between
2124 * interrupt A and B. They can be used by software to assist with more complex descriptor usage. By
2125 * convention, interrupt A may be used when only one interrupt flag is needed.
2126 * 0b0..No effect.
2127 * 0b1..Set. The INTB flag for this channel will be set when the current descriptor is exhausted.
2128 */
2129#define DMA_CHANNEL_XFERCFG_SETINTB(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_SETINTB_SHIFT)) & DMA_CHANNEL_XFERCFG_SETINTB_MASK)
2130#define DMA_CHANNEL_XFERCFG_WIDTH_MASK (0x300U)
2131#define DMA_CHANNEL_XFERCFG_WIDTH_SHIFT (8U)
2132/*! WIDTH - Transfer width used for this DMA channel.
2133 * 0b00..8-bit. 8-bit transfers are performed (8-bit source reads and destination writes).
2134 * 0b01..16-bit. 6-bit transfers are performed (16-bit source reads and destination writes).
2135 * 0b10..32-bit. 32-bit transfers are performed (32-bit source reads and destination writes).
2136 * 0b11..Reserved. Reserved setting, do not use.
2137 */
2138#define DMA_CHANNEL_XFERCFG_WIDTH(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_WIDTH_SHIFT)) & DMA_CHANNEL_XFERCFG_WIDTH_MASK)
2139#define DMA_CHANNEL_XFERCFG_SRCINC_MASK (0x3000U)
2140#define DMA_CHANNEL_XFERCFG_SRCINC_SHIFT (12U)
2141/*! SRCINC - Determines whether the source address is incremented for each DMA transfer.
2142 * 0b00..No increment. The source address is not incremented for each transfer. This is the usual case when the source is a peripheral device.
2143 * 0b01..1 x width. The source address is incremented by the amount specified by Width for each transfer. This is
2144 * the usual case when the source is memory.
2145 * 0b10..2 x width. The source address is incremented by 2 times the amount specified by Width for each transfer.
2146 * 0b11..4 x width. The source address is incremented by 4 times the amount specified by Width for each transfer.
2147 */
2148#define DMA_CHANNEL_XFERCFG_SRCINC(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_SRCINC_SHIFT)) & DMA_CHANNEL_XFERCFG_SRCINC_MASK)
2149#define DMA_CHANNEL_XFERCFG_DSTINC_MASK (0xC000U)
2150#define DMA_CHANNEL_XFERCFG_DSTINC_SHIFT (14U)
2151/*! DSTINC - Determines whether the destination address is incremented for each DMA transfer.
2152 * 0b00..No increment. The destination address is not incremented for each transfer. This is the usual case when
2153 * the destination is a peripheral device.
2154 * 0b01..1 x width. The destination address is incremented by the amount specified by Width for each transfer.
2155 * This is the usual case when the destination is memory.
2156 * 0b10..2 x width. The destination address is incremented by 2 times the amount specified by Width for each transfer.
2157 * 0b11..4 x width. The destination address is incremented by 4 times the amount specified by Width for each transfer.
2158 */
2159#define DMA_CHANNEL_XFERCFG_DSTINC(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_DSTINC_SHIFT)) & DMA_CHANNEL_XFERCFG_DSTINC_MASK)
2160#define DMA_CHANNEL_XFERCFG_XFERCOUNT_MASK (0x3FF0000U)
2161#define DMA_CHANNEL_XFERCFG_XFERCOUNT_SHIFT (16U)
2162/*! XFERCOUNT - Total number of transfers to be performed, minus 1 encoded. The number of bytes
2163 * transferred is: (XFERCOUNT + 1) x data width (as defined by the WIDTH field). The DMA controller
2164 * uses this bit field during transfer to count down. Hence, it cannot be used by software to read
2165 * back the size of the transfer, for instance, in an interrupt handler. 0x0 = a total of 1
2166 * transfer will be performed. 0x1 = a total of 2 transfers will be performed. 0x3FF = a total of
2167 * 1,024 transfers will be performed.
2168 */
2169#define DMA_CHANNEL_XFERCFG_XFERCOUNT(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_XFERCOUNT_SHIFT)) & DMA_CHANNEL_XFERCFG_XFERCOUNT_MASK)
2170/*! @} */
2171
2172/* The count of DMA_CHANNEL_XFERCFG */
2173#define DMA_CHANNEL_XFERCFG_COUNT (20U)
2174
2175
2176/*!
2177 * @}
2178 */ /* end of group DMA_Register_Masks */
2179
2180
2181/* DMA - Peripheral instance base addresses */
2182/** Peripheral DMA0 base address */
2183#define DMA0_BASE (0x40082000u)
2184/** Peripheral DMA0 base pointer */
2185#define DMA0 ((DMA_Type *)DMA0_BASE)
2186/** Array initializer of DMA peripheral base addresses */
2187#define DMA_BASE_ADDRS { DMA0_BASE }
2188/** Array initializer of DMA peripheral base pointers */
2189#define DMA_BASE_PTRS { DMA0 }
2190/** Interrupt vectors for the DMA peripheral type */
2191#define DMA_IRQS { DMA0_IRQn }
2192
2193/*!
2194 * @}
2195 */ /* end of group DMA_Peripheral_Access_Layer */
2196
2197
2198/* ----------------------------------------------------------------------------
2199 -- DMIC Peripheral Access Layer
2200 ---------------------------------------------------------------------------- */
2201
2202/*!
2203 * @addtogroup DMIC_Peripheral_Access_Layer DMIC Peripheral Access Layer
2204 * @{
2205 */
2206
2207/** DMIC - Register Layout Typedef */
2208typedef struct {
2209 struct { /* offset: 0x0, array step: 0x100 */
2210 __IO uint32_t OSR; /**< Oversample Rate register 0, array offset: 0x0, array step: 0x100 */
2211 __IO uint32_t DIVHFCLK; /**< DMIC Clock Register 0, array offset: 0x4, array step: 0x100 */
2212 __IO uint32_t PREAC2FSCOEF; /**< Pre-Emphasis Filter Coefficient for 2 FS register, array offset: 0x8, array step: 0x100 */
2213 __IO uint32_t PREAC4FSCOEF; /**< Pre-Emphasis Filter Coefficient for 4 FS register, array offset: 0xC, array step: 0x100 */
2214 __IO uint32_t GAINSHIFT; /**< Decimator Gain Shift register, array offset: 0x10, array step: 0x100 */
2215 uint8_t RESERVED_0[108];
2216 __IO uint32_t FIFO_CTRL; /**< FIFO Control register 0, array offset: 0x80, array step: 0x100 */
2217 __IO uint32_t FIFO_STATUS; /**< FIFO Status register 0, array offset: 0x84, array step: 0x100 */
2218 __IO uint32_t FIFO_DATA; /**< FIFO Data Register 0, array offset: 0x88, array step: 0x100 */
2219 __IO uint32_t PHY_CTRL; /**< PDM Source Configuration register 0, array offset: 0x8C, array step: 0x100 */
2220 __IO uint32_t DC_CTRL; /**< DC Control register 0, array offset: 0x90, array step: 0x100 */
2221 uint8_t RESERVED_1[108];
2222 } CHANNEL[2];
2223 uint8_t RESERVED_0[3328];
2224 __IO uint32_t CHANEN; /**< Channel Enable register, offset: 0xF00 */
2225 uint8_t RESERVED_1[8];
2226 __IO uint32_t IOCFG; /**< I/O Configuration register, offset: 0xF0C */
2227 __IO uint32_t USE2FS; /**< Use 2FS register, offset: 0xF10 */
2228 uint8_t RESERVED_2[108];
2229 __IO uint32_t HWVADGAIN; /**< HWVAD input gain register, offset: 0xF80 */
2230 __IO uint32_t HWVADHPFS; /**< HWVAD filter control register, offset: 0xF84 */
2231 __IO uint32_t HWVADST10; /**< HWVAD control register, offset: 0xF88 */
2232 __IO uint32_t HWVADRSTT; /**< HWVAD filter reset register, offset: 0xF8C */
2233 __IO uint32_t HWVADTHGN; /**< HWVAD noise estimator gain register, offset: 0xF90 */
2234 __IO uint32_t HWVADTHGS; /**< HWVAD signal estimator gain register, offset: 0xF94 */
2235 __I uint32_t HWVADLOWZ; /**< HWVAD noise envelope estimator register, offset: 0xF98 */
2236 uint8_t RESERVED_3[96];
2237 __I uint32_t ID; /**< Module Identification register, offset: 0xFFC */
2238} DMIC_Type;
2239
2240/* ----------------------------------------------------------------------------
2241 -- DMIC Register Masks
2242 ---------------------------------------------------------------------------- */
2243
2244/*!
2245 * @addtogroup DMIC_Register_Masks DMIC Register Masks
2246 * @{
2247 */
2248
2249/*! @name CHANNEL_OSR - Oversample Rate register 0 */
2250/*! @{ */
2251#define DMIC_CHANNEL_OSR_OSR_MASK (0xFFU)
2252#define DMIC_CHANNEL_OSR_OSR_SHIFT (0U)
2253/*! OSR - Selects the oversample rate for the related input channel.
2254 */
2255#define DMIC_CHANNEL_OSR_OSR(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_OSR_OSR_SHIFT)) & DMIC_CHANNEL_OSR_OSR_MASK)
2256/*! @} */
2257
2258/* The count of DMIC_CHANNEL_OSR */
2259#define DMIC_CHANNEL_OSR_COUNT (2U)
2260
2261/*! @name CHANNEL_DIVHFCLK - DMIC Clock Register 0 */
2262/*! @{ */
2263#define DMIC_CHANNEL_DIVHFCLK_PDMDIV_MASK (0xFU)
2264#define DMIC_CHANNEL_DIVHFCLK_PDMDIV_SHIFT (0U)
2265/*! PDMDIV - PDM clock divider value. 0 = divide by 1 1 = divide by 2 2 = divide by 3 3 = divide by
2266 * 4 4 = divide by 6 5 = divide by 8 6 = divide by 12 7 = divide by 16 8 = divide by 24 9 =
2267 * divide by 32 10 = divide by 48 11 = divide by 64 12 = divide by 96 13 = divide by 128 others =
2268 * reserved.
2269 */
2270#define DMIC_CHANNEL_DIVHFCLK_PDMDIV(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_DIVHFCLK_PDMDIV_SHIFT)) & DMIC_CHANNEL_DIVHFCLK_PDMDIV_MASK)
2271/*! @} */
2272
2273/* The count of DMIC_CHANNEL_DIVHFCLK */
2274#define DMIC_CHANNEL_DIVHFCLK_COUNT (2U)
2275
2276/*! @name CHANNEL_PREAC2FSCOEF - Pre-Emphasis Filter Coefficient for 2 FS register */
2277/*! @{ */
2278#define DMIC_CHANNEL_PREAC2FSCOEF_COMP_MASK (0x3U)
2279#define DMIC_CHANNEL_PREAC2FSCOEF_COMP_SHIFT (0U)
2280/*! COMP - Pre-emphasis filer coefficient for 2 FS mode. 0 = Compensation = 0 1 = Compensation = 16
2281 * 2 = Compensation = 15 3 = Compensation = 13
2282 */
2283#define DMIC_CHANNEL_PREAC2FSCOEF_COMP(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_PREAC2FSCOEF_COMP_SHIFT)) & DMIC_CHANNEL_PREAC2FSCOEF_COMP_MASK)
2284/*! @} */
2285
2286/* The count of DMIC_CHANNEL_PREAC2FSCOEF */
2287#define DMIC_CHANNEL_PREAC2FSCOEF_COUNT (2U)
2288
2289/*! @name CHANNEL_PREAC4FSCOEF - Pre-Emphasis Filter Coefficient for 4 FS register */
2290/*! @{ */
2291#define DMIC_CHANNEL_PREAC4FSCOEF_COMP_MASK (0x3U)
2292#define DMIC_CHANNEL_PREAC4FSCOEF_COMP_SHIFT (0U)
2293/*! COMP - Pre-emphasis filer coefficient for 4 FS mode. 0 = Compensation = 0 1 = Compensation = 16
2294 * 2 = Compensation = 15 3 = Compensation = 13
2295 */
2296#define DMIC_CHANNEL_PREAC4FSCOEF_COMP(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_PREAC4FSCOEF_COMP_SHIFT)) & DMIC_CHANNEL_PREAC4FSCOEF_COMP_MASK)
2297/*! @} */
2298
2299/* The count of DMIC_CHANNEL_PREAC4FSCOEF */
2300#define DMIC_CHANNEL_PREAC4FSCOEF_COUNT (2U)
2301
2302/*! @name CHANNEL_GAINSHIFT - Decimator Gain Shift register */
2303/*! @{ */
2304#define DMIC_CHANNEL_GAINSHIFT_GAIN_MASK (0x3FU)
2305#define DMIC_CHANNEL_GAINSHIFT_GAIN_SHIFT (0U)
2306/*! GAIN - Gain control, as a positive or negative (two's complement) number of bits to shift.
2307 */
2308#define DMIC_CHANNEL_GAINSHIFT_GAIN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_GAINSHIFT_GAIN_SHIFT)) & DMIC_CHANNEL_GAINSHIFT_GAIN_MASK)
2309/*! @} */
2310
2311/* The count of DMIC_CHANNEL_GAINSHIFT */
2312#define DMIC_CHANNEL_GAINSHIFT_COUNT (2U)
2313
2314/*! @name CHANNEL_FIFO_CTRL - FIFO Control register 0 */
2315/*! @{ */
2316#define DMIC_CHANNEL_FIFO_CTRL_ENABLE_MASK (0x1U)
2317#define DMIC_CHANNEL_FIFO_CTRL_ENABLE_SHIFT (0U)
2318/*! ENABLE - FIFO enable.
2319 * 0b0..FIFO is not enabled. Enabling a DMIC channel with the FIFO disabled could be useful while data is being
2320 * streamed to the I2S, or in order to avoid a filter settling delay when a channel is re-enabled after a
2321 * period when the data was not needed.
2322 * 0b1..FIFO is enabled. The FIFO must be enabled in order for the CPU or DMA to read data from the DMIC via the FIFODATA register.
2323 */
2324#define DMIC_CHANNEL_FIFO_CTRL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_CTRL_ENABLE_SHIFT)) & DMIC_CHANNEL_FIFO_CTRL_ENABLE_MASK)
2325#define DMIC_CHANNEL_FIFO_CTRL_RESETN_MASK (0x2U)
2326#define DMIC_CHANNEL_FIFO_CTRL_RESETN_SHIFT (1U)
2327/*! RESETN - FIFO reset.
2328 * 0b0..Reset the FIFO.
2329 * 0b1..Normal operation
2330 */
2331#define DMIC_CHANNEL_FIFO_CTRL_RESETN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_CTRL_RESETN_SHIFT)) & DMIC_CHANNEL_FIFO_CTRL_RESETN_MASK)
2332#define DMIC_CHANNEL_FIFO_CTRL_INTEN_MASK (0x4U)
2333#define DMIC_CHANNEL_FIFO_CTRL_INTEN_SHIFT (2U)
2334/*! INTEN - Interrupt enable.
2335 * 0b0..FIFO level interrupts are not enabled.
2336 * 0b1..FIFO level interrupts are enabled.
2337 */
2338#define DMIC_CHANNEL_FIFO_CTRL_INTEN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_CTRL_INTEN_SHIFT)) & DMIC_CHANNEL_FIFO_CTRL_INTEN_MASK)
2339#define DMIC_CHANNEL_FIFO_CTRL_DMAEN_MASK (0x8U)
2340#define DMIC_CHANNEL_FIFO_CTRL_DMAEN_SHIFT (3U)
2341/*! DMAEN - DMA enable
2342 * 0b0..DMA requests are not enabled.
2343 * 0b1..DMA requests based on FIFO level are enabled.
2344 */
2345#define DMIC_CHANNEL_FIFO_CTRL_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_CTRL_DMAEN_SHIFT)) & DMIC_CHANNEL_FIFO_CTRL_DMAEN_MASK)
2346#define DMIC_CHANNEL_FIFO_CTRL_TRIGLVL_MASK (0x1F0000U)
2347#define DMIC_CHANNEL_FIFO_CTRL_TRIGLVL_SHIFT (16U)
2348/*! TRIGLVL - FIFO trigger level. Selects the data trigger level for interrupt or DMA operation. If
2349 * enabled to do so, the FIFO level can wake up the device just enough to perform DMA, then
2350 * return to the reduced power mode See Section 4.5.66 'Hardware Wake-up control register'. 0 =
2351 * trigger when the FIFO has received one entry (is no longer empty). 1 = trigger when the FIFO has
2352 * received two entries. 15 = trigger when the FIFO has received 16 entries (has become full).
2353 */
2354#define DMIC_CHANNEL_FIFO_CTRL_TRIGLVL(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_CTRL_TRIGLVL_SHIFT)) & DMIC_CHANNEL_FIFO_CTRL_TRIGLVL_MASK)
2355/*! @} */
2356
2357/* The count of DMIC_CHANNEL_FIFO_CTRL */
2358#define DMIC_CHANNEL_FIFO_CTRL_COUNT (2U)
2359
2360/*! @name CHANNEL_FIFO_STATUS - FIFO Status register 0 */
2361/*! @{ */
2362#define DMIC_CHANNEL_FIFO_STATUS_INT_MASK (0x1U)
2363#define DMIC_CHANNEL_FIFO_STATUS_INT_SHIFT (0U)
2364/*! INT - Interrupt flag. Asserted when FIFO data reaches the level specified in the FIFOCTRL
2365 * register. Writing a one to this bit clears the flag. Remark: note that the bus clock to the DMIC
2366 * subsystem must be running in order for an interrupt to occur.
2367 */
2368#define DMIC_CHANNEL_FIFO_STATUS_INT(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_STATUS_INT_SHIFT)) & DMIC_CHANNEL_FIFO_STATUS_INT_MASK)
2369#define DMIC_CHANNEL_FIFO_STATUS_OVERRUN_MASK (0x2U)
2370#define DMIC_CHANNEL_FIFO_STATUS_OVERRUN_SHIFT (1U)
2371/*! OVERRUN - Overrun flag. Indicates that a FIFO overflow has occurred at some point. Writing a one
2372 * to this bit clears the flag. This flag does not cause an interrupt.
2373 */
2374#define DMIC_CHANNEL_FIFO_STATUS_OVERRUN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_STATUS_OVERRUN_SHIFT)) & DMIC_CHANNEL_FIFO_STATUS_OVERRUN_MASK)
2375#define DMIC_CHANNEL_FIFO_STATUS_UNDERRUN_MASK (0x4U)
2376#define DMIC_CHANNEL_FIFO_STATUS_UNDERRUN_SHIFT (2U)
2377/*! UNDERRUN - Underrun flag. Indicates that a FIFO underflow has occurred at some point. Writing a one to this bit clears the flag.
2378 */
2379#define DMIC_CHANNEL_FIFO_STATUS_UNDERRUN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_STATUS_UNDERRUN_SHIFT)) & DMIC_CHANNEL_FIFO_STATUS_UNDERRUN_MASK)
2380/*! @} */
2381
2382/* The count of DMIC_CHANNEL_FIFO_STATUS */
2383#define DMIC_CHANNEL_FIFO_STATUS_COUNT (2U)
2384
2385/*! @name CHANNEL_FIFO_DATA - FIFO Data Register 0 */
2386/*! @{ */
2387#define DMIC_CHANNEL_FIFO_DATA_DATA_MASK (0xFFFFFFU)
2388#define DMIC_CHANNEL_FIFO_DATA_DATA_SHIFT (0U)
2389/*! DATA - Data from the top of the input filter FIFO.
2390 */
2391#define DMIC_CHANNEL_FIFO_DATA_DATA(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_DATA_DATA_SHIFT)) & DMIC_CHANNEL_FIFO_DATA_DATA_MASK)
2392/*! @} */
2393
2394/* The count of DMIC_CHANNEL_FIFO_DATA */
2395#define DMIC_CHANNEL_FIFO_DATA_COUNT (2U)
2396
2397/*! @name CHANNEL_PHY_CTRL - PDM Source Configuration register 0 */
2398/*! @{ */
2399#define DMIC_CHANNEL_PHY_CTRL_PHY_FALL_MASK (0x1U)
2400#define DMIC_CHANNEL_PHY_CTRL_PHY_FALL_SHIFT (0U)
2401/*! PHY_FALL - Capture PDM_DATA
2402 * 0b0..Capture PDM_DATA on the rising edge of PDM_CLK.
2403 * 0b1..Capture PDM_DATA on the falling edge of PDM_CLK.
2404 */
2405#define DMIC_CHANNEL_PHY_CTRL_PHY_FALL(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_PHY_CTRL_PHY_FALL_SHIFT)) & DMIC_CHANNEL_PHY_CTRL_PHY_FALL_MASK)
2406#define DMIC_CHANNEL_PHY_CTRL_PHY_HALF_MASK (0x2U)
2407#define DMIC_CHANNEL_PHY_CTRL_PHY_HALF_SHIFT (1U)
2408/*! PHY_HALF - Half rate sampling
2409 * 0b0..Standard half rate sampling. The clock to the DMIC is sent at the same rate as the decimator is providing.
2410 * 0b1..Use half rate sampling. The clock to the DMIC is sent at half the rate as the decimator is providing.
2411 */
2412#define DMIC_CHANNEL_PHY_CTRL_PHY_HALF(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_PHY_CTRL_PHY_HALF_SHIFT)) & DMIC_CHANNEL_PHY_CTRL_PHY_HALF_MASK)
2413/*! @} */
2414
2415/* The count of DMIC_CHANNEL_PHY_CTRL */
2416#define DMIC_CHANNEL_PHY_CTRL_COUNT (2U)
2417
2418/*! @name CHANNEL_DC_CTRL - DC Control register 0 */
2419/*! @{ */
2420#define DMIC_CHANNEL_DC_CTRL_DCPOLE_MASK (0x3U)
2421#define DMIC_CHANNEL_DC_CTRL_DCPOLE_SHIFT (0U)
2422/*! DCPOLE - DC block filter
2423 * 0b00..Flat response, no filter.
2424 * 0b01..155 Hz.
2425 * 0b10..78 Hz.
2426 * 0b11..39 Hz
2427 */
2428#define DMIC_CHANNEL_DC_CTRL_DCPOLE(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_DC_CTRL_DCPOLE_SHIFT)) & DMIC_CHANNEL_DC_CTRL_DCPOLE_MASK)
2429#define DMIC_CHANNEL_DC_CTRL_DCGAIN_MASK (0xF0U)
2430#define DMIC_CHANNEL_DC_CTRL_DCGAIN_SHIFT (4U)
2431/*! DCGAIN - Fine gain adjustment in the form of a number of bits to downshift.
2432 */
2433#define DMIC_CHANNEL_DC_CTRL_DCGAIN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_DC_CTRL_DCGAIN_SHIFT)) & DMIC_CHANNEL_DC_CTRL_DCGAIN_MASK)
2434#define DMIC_CHANNEL_DC_CTRL_SATURATEAT16BIT_MASK (0x100U)
2435#define DMIC_CHANNEL_DC_CTRL_SATURATEAT16BIT_SHIFT (8U)
2436/*! SATURATEAT16BIT - Selects 16-bit saturation.
2437 * 0b0..Results roll over if out range and do not saturate.
2438 * 0b1..If the result overflows, it saturates at 0xFFFF for positive overflow and 0x8000 for negative overflow.
2439 */
2440#define DMIC_CHANNEL_DC_CTRL_SATURATEAT16BIT(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_DC_CTRL_SATURATEAT16BIT_SHIFT)) & DMIC_CHANNEL_DC_CTRL_SATURATEAT16BIT_MASK)
2441/*! @} */
2442
2443/* The count of DMIC_CHANNEL_DC_CTRL */
2444#define DMIC_CHANNEL_DC_CTRL_COUNT (2U)
2445
2446/*! @name CHANEN - Channel Enable register */
2447/*! @{ */
2448#define DMIC_CHANEN_EN_CH0_MASK (0x1U)
2449#define DMIC_CHANEN_EN_CH0_SHIFT (0U)
2450/*! EN_CH0 - Enable channel 0. When 1, PDM channel 0 is enabled.
2451 */
2452#define DMIC_CHANEN_EN_CH0(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANEN_EN_CH0_SHIFT)) & DMIC_CHANEN_EN_CH0_MASK)
2453#define DMIC_CHANEN_EN_CH1_MASK (0x2U)
2454#define DMIC_CHANEN_EN_CH1_SHIFT (1U)
2455/*! EN_CH1 - Enable channel 1. When 1, PDM channel 1 is enabled.
2456 */
2457#define DMIC_CHANEN_EN_CH1(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANEN_EN_CH1_SHIFT)) & DMIC_CHANEN_EN_CH1_MASK)
2458/*! @} */
2459
2460/*! @name IOCFG - I/O Configuration register */
2461/*! @{ */
2462#define DMIC_IOCFG_CLK_BYPASS0_MASK (0x1U)
2463#define DMIC_IOCFG_CLK_BYPASS0_SHIFT (0U)
2464/*! CLK_BYPASS0 - Bypass CLK0. When 1, PDM_DATA1 becomes the clock for PDM channel 0. This provides
2465 * for the possibility of an external codec taking over the PDM bus.
2466 */
2467#define DMIC_IOCFG_CLK_BYPASS0(x) (((uint32_t)(((uint32_t)(x)) << DMIC_IOCFG_CLK_BYPASS0_SHIFT)) & DMIC_IOCFG_CLK_BYPASS0_MASK)
2468#define DMIC_IOCFG_CLK_BYPASS1_MASK (0x2U)
2469#define DMIC_IOCFG_CLK_BYPASS1_SHIFT (1U)
2470/*! CLK_BYPASS1 - Bypass CLK1. When 1, PDM_DATA1 becomes the clock for PDM channel 1. This provides
2471 * for the possibility of an external codec taking over the PDM bus.
2472 */
2473#define DMIC_IOCFG_CLK_BYPASS1(x) (((uint32_t)(((uint32_t)(x)) << DMIC_IOCFG_CLK_BYPASS1_SHIFT)) & DMIC_IOCFG_CLK_BYPASS1_MASK)
2474#define DMIC_IOCFG_STEREO_DATA0_MASK (0x4U)
2475#define DMIC_IOCFG_STEREO_DATA0_SHIFT (2U)
2476/*! STEREO_DATA0 - Stereo PDM select. When 1, PDM_DATA0 is routed to both PDM channels in a
2477 * configuration that supports a single stereo digital microphone.
2478 */
2479#define DMIC_IOCFG_STEREO_DATA0(x) (((uint32_t)(((uint32_t)(x)) << DMIC_IOCFG_STEREO_DATA0_SHIFT)) & DMIC_IOCFG_STEREO_DATA0_MASK)
2480/*! @} */
2481
2482/*! @name USE2FS - Use 2FS register */
2483/*! @{ */
2484#define DMIC_USE2FS_USE2FS_MASK (0x1U)
2485#define DMIC_USE2FS_USE2FS_SHIFT (0U)
2486/*! USE2FS - Use 2FS register
2487 * 0b0..Use 1FS output for PCM data.
2488 * 0b1..Use 2FS output for PCM data.
2489 */
2490#define DMIC_USE2FS_USE2FS(x) (((uint32_t)(((uint32_t)(x)) << DMIC_USE2FS_USE2FS_SHIFT)) & DMIC_USE2FS_USE2FS_MASK)
2491/*! @} */
2492
2493/*! @name HWVADGAIN - HWVAD input gain register */
2494/*! @{ */
2495#define DMIC_HWVADGAIN_INPUTGAIN_MASK (0xFU)
2496#define DMIC_HWVADGAIN_INPUTGAIN_SHIFT (0U)
2497/*! INPUTGAIN - Shift value for input bits 0x00 -10 bits 0x01 -8 bits 0x02 -6 bits 0x03 -4 bits 0x04
2498 * -2 bits 0x05 0 bits (default) 0x06 +2 bits 0x07 +4 bits 0x08 +6 bits 0x09 +8 bits 0x0A +10
2499 * bits 0x0B +12 bits 0x0C +14 bits 0x0D to 0x0F Reserved.
2500 */
2501#define DMIC_HWVADGAIN_INPUTGAIN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADGAIN_INPUTGAIN_SHIFT)) & DMIC_HWVADGAIN_INPUTGAIN_MASK)
2502/*! @} */
2503
2504/*! @name HWVADHPFS - HWVAD filter control register */
2505/*! @{ */
2506#define DMIC_HWVADHPFS_HPFS_MASK (0x3U)
2507#define DMIC_HWVADHPFS_HPFS_SHIFT (0U)
2508/*! HPFS - High pass filter
2509 * 0b00..First filter by-pass.
2510 * 0b01..High pass filter with -3dB cut-off at 1750Hz.
2511 * 0b10..High pass filter with -3dB cut-off at 215Hz.
2512 * 0b11..Reserved.
2513 */
2514#define DMIC_HWVADHPFS_HPFS(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADHPFS_HPFS_SHIFT)) & DMIC_HWVADHPFS_HPFS_MASK)
2515/*! @} */
2516
2517/*! @name HWVADST10 - HWVAD control register */
2518/*! @{ */
2519#define DMIC_HWVADST10_ST10_MASK (0x1U)
2520#define DMIC_HWVADST10_ST10_SHIFT (0U)
2521/*! ST10 - Stage 0
2522 * 0b0..Normal operation, waiting for HWVAD trigger event (stage 0).
2523 * 0b1..Reset internal interrupt flag by writing a '1' pulse.
2524 */
2525#define DMIC_HWVADST10_ST10(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADST10_ST10_SHIFT)) & DMIC_HWVADST10_ST10_MASK)
2526/*! @} */
2527
2528/*! @name HWVADRSTT - HWVAD filter reset register */
2529/*! @{ */
2530#define DMIC_HWVADRSTT_RSTT_MASK (0x1U)
2531#define DMIC_HWVADRSTT_RSTT_SHIFT (0U)
2532/*! RSTT - Writing a 1 resets all filter values
2533 */
2534#define DMIC_HWVADRSTT_RSTT(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADRSTT_RSTT_SHIFT)) & DMIC_HWVADRSTT_RSTT_MASK)
2535/*! @} */
2536
2537/*! @name HWVADTHGN - HWVAD noise estimator gain register */
2538/*! @{ */
2539#define DMIC_HWVADTHGN_THGN_MASK (0xFU)
2540#define DMIC_HWVADTHGN_THGN_SHIFT (0U)
2541/*! THGN - Gain value for the noise estimator. Values 0 to 14. 0 corresponds to a gain of 1.
2542 */
2543#define DMIC_HWVADTHGN_THGN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADTHGN_THGN_SHIFT)) & DMIC_HWVADTHGN_THGN_MASK)
2544/*! @} */
2545
2546/*! @name HWVADTHGS - HWVAD signal estimator gain register */
2547/*! @{ */
2548#define DMIC_HWVADTHGS_THGS_MASK (0xFU)
2549#define DMIC_HWVADTHGS_THGS_SHIFT (0U)
2550/*! THGS - Gain value for the signal estimator. Values 0 to 14. 0 corresponds to a gain of 1.
2551 */
2552#define DMIC_HWVADTHGS_THGS(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADTHGS_THGS_SHIFT)) & DMIC_HWVADTHGS_THGS_MASK)
2553/*! @} */
2554
2555/*! @name HWVADLOWZ - HWVAD noise envelope estimator register */
2556/*! @{ */
2557#define DMIC_HWVADLOWZ_LOWZ_MASK (0xFFFFU)
2558#define DMIC_HWVADLOWZ_LOWZ_SHIFT (0U)
2559/*! LOWZ - Noise envelope estimator value.
2560 */
2561#define DMIC_HWVADLOWZ_LOWZ(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADLOWZ_LOWZ_SHIFT)) & DMIC_HWVADLOWZ_LOWZ_MASK)
2562/*! @} */
2563
2564/*! @name ID - Module Identification register */
2565/*! @{ */
2566#define DMIC_ID_ID_MASK (0xFFFFFFFFU)
2567#define DMIC_ID_ID_SHIFT (0U)
2568/*! ID - Indicates module ID and the number of channels in this DMIC interface.
2569 */
2570#define DMIC_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << DMIC_ID_ID_SHIFT)) & DMIC_ID_ID_MASK)
2571/*! @} */
2572
2573
2574/*!
2575 * @}
2576 */ /* end of group DMIC_Register_Masks */
2577
2578
2579/* DMIC - Peripheral instance base addresses */
2580/** Peripheral DMIC0 base address */
2581#define DMIC0_BASE (0x40090000u)
2582/** Peripheral DMIC0 base pointer */
2583#define DMIC0 ((DMIC_Type *)DMIC0_BASE)
2584/** Array initializer of DMIC peripheral base addresses */
2585#define DMIC_BASE_ADDRS { DMIC0_BASE }
2586/** Array initializer of DMIC peripheral base pointers */
2587#define DMIC_BASE_PTRS { DMIC0 }
2588/** Interrupt vectors for the DMIC peripheral type */
2589#define DMIC_IRQS { DMIC0_IRQn }
2590#define DMIC_HWVAD_IRQS { HWVAD0_IRQn }
2591
2592/*!
2593 * @}
2594 */ /* end of group DMIC_Peripheral_Access_Layer */
2595
2596
2597/* ----------------------------------------------------------------------------
2598 -- FLEXCOMM Peripheral Access Layer
2599 ---------------------------------------------------------------------------- */
2600
2601/*!
2602 * @addtogroup FLEXCOMM_Peripheral_Access_Layer FLEXCOMM Peripheral Access Layer
2603 * @{
2604 */
2605
2606/** FLEXCOMM - Register Layout Typedef */
2607typedef struct {
2608 uint8_t RESERVED_0[4088];
2609 __IO uint32_t PSELID; /**< Peripheral Select and Flexcomm ID register., offset: 0xFF8 */
2610 __I uint32_t PID; /**< Peripheral identification register., offset: 0xFFC */
2611} FLEXCOMM_Type;
2612
2613/* ----------------------------------------------------------------------------
2614 -- FLEXCOMM Register Masks
2615 ---------------------------------------------------------------------------- */
2616
2617/*!
2618 * @addtogroup FLEXCOMM_Register_Masks FLEXCOMM Register Masks
2619 * @{
2620 */
2621
2622/*! @name PSELID - Peripheral Select and Flexcomm ID register. */
2623/*! @{ */
2624#define FLEXCOMM_PSELID_PERSEL_MASK (0x7U)
2625#define FLEXCOMM_PSELID_PERSEL_SHIFT (0U)
2626/*! PERSEL - Peripheral Select. This field is writable by software.
2627 * 0b000..No peripheral selected.
2628 * 0b001..USART function selected.
2629 * 0b010..SPI function selected.
2630 * 0b011..I2C function selected.
2631 * 0b100..I2S transmit function selected.
2632 * 0b101..I2S receive function selected.
2633 * 0b110..Reserved
2634 * 0b111..Reserved
2635 */
2636#define FLEXCOMM_PSELID_PERSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_PERSEL_SHIFT)) & FLEXCOMM_PSELID_PERSEL_MASK)
2637#define FLEXCOMM_PSELID_LOCK_MASK (0x8U)
2638#define FLEXCOMM_PSELID_LOCK_SHIFT (3U)
2639/*! LOCK - Lock the peripheral select. This field is writable by software.
2640 * 0b0..Peripheral select can be changed by software.
2641 * 0b1..Peripheral select is locked and cannot be changed until this Flexcomm or the entire device is reset.
2642 */
2643#define FLEXCOMM_PSELID_LOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_LOCK_SHIFT)) & FLEXCOMM_PSELID_LOCK_MASK)
2644#define FLEXCOMM_PSELID_USARTPRESENT_MASK (0x10U)
2645#define FLEXCOMM_PSELID_USARTPRESENT_SHIFT (4U)
2646/*! USARTPRESENT - USART present indicator. This field is Read-only.
2647 * 0b0..This Flexcomm does not include the USART function.
2648 * 0b1..This Flexcomm includes the USART function.
2649 */
2650#define FLEXCOMM_PSELID_USARTPRESENT(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_USARTPRESENT_SHIFT)) & FLEXCOMM_PSELID_USARTPRESENT_MASK)
2651#define FLEXCOMM_PSELID_SPIPRESENT_MASK (0x20U)
2652#define FLEXCOMM_PSELID_SPIPRESENT_SHIFT (5U)
2653/*! SPIPRESENT - SPI present indicator. This field is Read-only.
2654 * 0b0..This Flexcomm does not include the SPI function.
2655 * 0b1..This Flexcomm includes the SPI function.
2656 */
2657#define FLEXCOMM_PSELID_SPIPRESENT(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_SPIPRESENT_SHIFT)) & FLEXCOMM_PSELID_SPIPRESENT_MASK)
2658#define FLEXCOMM_PSELID_I2CPRESENT_MASK (0x40U)
2659#define FLEXCOMM_PSELID_I2CPRESENT_SHIFT (6U)
2660/*! I2CPRESENT - I2C present indicator. This field is Read-only.
2661 * 0b0..This Flexcomm does not include the I2C function.
2662 * 0b1..This Flexcomm includes the I2C function.
2663 */
2664#define FLEXCOMM_PSELID_I2CPRESENT(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_I2CPRESENT_SHIFT)) & FLEXCOMM_PSELID_I2CPRESENT_MASK)
2665#define FLEXCOMM_PSELID_I2SPRESENT_MASK (0x80U)
2666#define FLEXCOMM_PSELID_I2SPRESENT_SHIFT (7U)
2667/*! I2SPRESENT - I 2S present indicator. This field is Read-only.
2668 * 0b0..This Flexcomm does not include the I2S function.
2669 * 0b1..This Flexcomm includes the I2S function.
2670 */
2671#define FLEXCOMM_PSELID_I2SPRESENT(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_I2SPRESENT_SHIFT)) & FLEXCOMM_PSELID_I2SPRESENT_MASK)
2672#define FLEXCOMM_PSELID_ID_MASK (0xFFFFF000U)
2673#define FLEXCOMM_PSELID_ID_SHIFT (12U)
2674/*! ID - Flexcomm ID.
2675 */
2676#define FLEXCOMM_PSELID_ID(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_ID_SHIFT)) & FLEXCOMM_PSELID_ID_MASK)
2677/*! @} */
2678
2679/*! @name PID - Peripheral identification register. */
2680/*! @{ */
2681#define FLEXCOMM_PID_Minor_Rev_MASK (0xF00U)
2682#define FLEXCOMM_PID_Minor_Rev_SHIFT (8U)
2683/*! Minor_Rev - Minor revision of module implementation.
2684 */
2685#define FLEXCOMM_PID_Minor_Rev(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PID_Minor_Rev_SHIFT)) & FLEXCOMM_PID_Minor_Rev_MASK)
2686#define FLEXCOMM_PID_Major_Rev_MASK (0xF000U)
2687#define FLEXCOMM_PID_Major_Rev_SHIFT (12U)
2688/*! Major_Rev - Major revision of module implementation.
2689 */
2690#define FLEXCOMM_PID_Major_Rev(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PID_Major_Rev_SHIFT)) & FLEXCOMM_PID_Major_Rev_MASK)
2691#define FLEXCOMM_PID_ID_MASK (0xFFFF0000U)
2692#define FLEXCOMM_PID_ID_SHIFT (16U)
2693/*! ID - Module identifier for the selected function.
2694 */
2695#define FLEXCOMM_PID_ID(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PID_ID_SHIFT)) & FLEXCOMM_PID_ID_MASK)
2696/*! @} */
2697
2698
2699/*!
2700 * @}
2701 */ /* end of group FLEXCOMM_Register_Masks */
2702
2703
2704/* FLEXCOMM - Peripheral instance base addresses */
2705/** Peripheral FLEXCOMM0 base address */
2706#define FLEXCOMM0_BASE (0x40086000u)
2707/** Peripheral FLEXCOMM0 base pointer */
2708#define FLEXCOMM0 ((FLEXCOMM_Type *)FLEXCOMM0_BASE)
2709/** Peripheral FLEXCOMM1 base address */
2710#define FLEXCOMM1_BASE (0x40087000u)
2711/** Peripheral FLEXCOMM1 base pointer */
2712#define FLEXCOMM1 ((FLEXCOMM_Type *)FLEXCOMM1_BASE)
2713/** Peripheral FLEXCOMM2 base address */
2714#define FLEXCOMM2_BASE (0x40088000u)
2715/** Peripheral FLEXCOMM2 base pointer */
2716#define FLEXCOMM2 ((FLEXCOMM_Type *)FLEXCOMM2_BASE)
2717/** Peripheral FLEXCOMM3 base address */
2718#define FLEXCOMM3_BASE (0x40089000u)
2719/** Peripheral FLEXCOMM3 base pointer */
2720#define FLEXCOMM3 ((FLEXCOMM_Type *)FLEXCOMM3_BASE)
2721/** Peripheral FLEXCOMM4 base address */
2722#define FLEXCOMM4_BASE (0x4008A000u)
2723/** Peripheral FLEXCOMM4 base pointer */
2724#define FLEXCOMM4 ((FLEXCOMM_Type *)FLEXCOMM4_BASE)
2725/** Peripheral FLEXCOMM5 base address */
2726#define FLEXCOMM5_BASE (0x40096000u)
2727/** Peripheral FLEXCOMM5 base pointer */
2728#define FLEXCOMM5 ((FLEXCOMM_Type *)FLEXCOMM5_BASE)
2729/** Peripheral FLEXCOMM6 base address */
2730#define FLEXCOMM6_BASE (0x40097000u)
2731/** Peripheral FLEXCOMM6 base pointer */
2732#define FLEXCOMM6 ((FLEXCOMM_Type *)FLEXCOMM6_BASE)
2733/** Peripheral FLEXCOMM7 base address */
2734#define FLEXCOMM7_BASE (0x40098000u)
2735/** Peripheral FLEXCOMM7 base pointer */
2736#define FLEXCOMM7 ((FLEXCOMM_Type *)FLEXCOMM7_BASE)
2737/** Array initializer of FLEXCOMM peripheral base addresses */
2738#define FLEXCOMM_BASE_ADDRS { FLEXCOMM0_BASE, FLEXCOMM1_BASE, FLEXCOMM2_BASE, FLEXCOMM3_BASE, FLEXCOMM4_BASE, FLEXCOMM5_BASE, FLEXCOMM6_BASE, FLEXCOMM7_BASE }
2739/** Array initializer of FLEXCOMM peripheral base pointers */
2740#define FLEXCOMM_BASE_PTRS { FLEXCOMM0, FLEXCOMM1, FLEXCOMM2, FLEXCOMM3, FLEXCOMM4, FLEXCOMM5, FLEXCOMM6, FLEXCOMM7 }
2741/** Interrupt vectors for the FLEXCOMM peripheral type */
2742#define FLEXCOMM_IRQS { FLEXCOMM0_IRQn, FLEXCOMM1_IRQn, FLEXCOMM2_IRQn, FLEXCOMM3_IRQn, FLEXCOMM4_IRQn, FLEXCOMM5_IRQn, FLEXCOMM6_IRQn, FLEXCOMM7_IRQn }
2743
2744/*!
2745 * @}
2746 */ /* end of group FLEXCOMM_Peripheral_Access_Layer */
2747
2748
2749/* ----------------------------------------------------------------------------
2750 -- GINT Peripheral Access Layer
2751 ---------------------------------------------------------------------------- */
2752
2753/*!
2754 * @addtogroup GINT_Peripheral_Access_Layer GINT Peripheral Access Layer
2755 * @{
2756 */
2757
2758/** GINT - Register Layout Typedef */
2759typedef struct {
2760 __IO uint32_t CTRL; /**< GPIO grouped interrupt control register, offset: 0x0 */
2761 uint8_t RESERVED_0[28];
2762 __IO uint32_t PORT_POL[2]; /**< GPIO grouped interrupt port 0 polarity register, array offset: 0x20, array step: 0x4 */
2763 uint8_t RESERVED_1[24];
2764 __IO uint32_t PORT_ENA[2]; /**< GPIO grouped interrupt port 0 enable register, array offset: 0x40, array step: 0x4 */
2765} GINT_Type;
2766
2767/* ----------------------------------------------------------------------------
2768 -- GINT Register Masks
2769 ---------------------------------------------------------------------------- */
2770
2771/*!
2772 * @addtogroup GINT_Register_Masks GINT Register Masks
2773 * @{
2774 */
2775
2776/*! @name CTRL - GPIO grouped interrupt control register */
2777/*! @{ */
2778#define GINT_CTRL_INT_MASK (0x1U)
2779#define GINT_CTRL_INT_SHIFT (0U)
2780/*! INT - Group interrupt status. This bit is cleared by writing a one to it. Writing zero has no effect.
2781 * 0b0..No request. No interrupt request is pending.
2782 * 0b1..Request active. Interrupt request is active.
2783 */
2784#define GINT_CTRL_INT(x) (((uint32_t)(((uint32_t)(x)) << GINT_CTRL_INT_SHIFT)) & GINT_CTRL_INT_MASK)
2785#define GINT_CTRL_COMB_MASK (0x2U)
2786#define GINT_CTRL_COMB_SHIFT (1U)
2787/*! COMB - Combine enabled inputs for group interrupt
2788 * 0b0..Or. OR functionality: A grouped interrupt is generated when any one of the enabled inputs is active (based on its programmed polarity).
2789 * 0b1..And. AND functionality: An interrupt is generated when all enabled bits are active (based on their programmed polarity).
2790 */
2791#define GINT_CTRL_COMB(x) (((uint32_t)(((uint32_t)(x)) << GINT_CTRL_COMB_SHIFT)) & GINT_CTRL_COMB_MASK)
2792#define GINT_CTRL_TRIG_MASK (0x4U)
2793#define GINT_CTRL_TRIG_SHIFT (2U)
2794/*! TRIG - Group interrupt trigger
2795 * 0b0..Edge-triggered.
2796 * 0b1..Level-triggered.
2797 */
2798#define GINT_CTRL_TRIG(x) (((uint32_t)(((uint32_t)(x)) << GINT_CTRL_TRIG_SHIFT)) & GINT_CTRL_TRIG_MASK)
2799/*! @} */
2800
2801/*! @name PORT_POL - GPIO grouped interrupt port 0 polarity register */
2802/*! @{ */
2803#define GINT_PORT_POL_POL_MASK (0xFFFFFFFFU)
2804#define GINT_PORT_POL_POL_SHIFT (0U)
2805/*! POL - Configure pin polarity of port m pins for group interrupt. Bit n corresponds to pin PIOm_n
2806 * of port m. 0 = the pin is active LOW. If the level on this pin is LOW, the pin contributes to
2807 * the group interrupt. 1 = the pin is active HIGH. If the level on this pin is HIGH, the pin
2808 * contributes to the group interrupt.
2809 */
2810#define GINT_PORT_POL_POL(x) (((uint32_t)(((uint32_t)(x)) << GINT_PORT_POL_POL_SHIFT)) & GINT_PORT_POL_POL_MASK)
2811/*! @} */
2812
2813/* The count of GINT_PORT_POL */
2814#define GINT_PORT_POL_COUNT (2U)
2815
2816/*! @name PORT_ENA - GPIO grouped interrupt port 0 enable register */
2817/*! @{ */
2818#define GINT_PORT_ENA_ENA_MASK (0xFFFFFFFFU)
2819#define GINT_PORT_ENA_ENA_SHIFT (0U)
2820/*! ENA - Enable port 0 pin for group interrupt. Bit n corresponds to pin Pm_n of port m. 0 = the
2821 * port 0 pin is disabled and does not contribute to the grouped interrupt. 1 = the port 0 pin is
2822 * enabled and contributes to the grouped interrupt.
2823 */
2824#define GINT_PORT_ENA_ENA(x) (((uint32_t)(((uint32_t)(x)) << GINT_PORT_ENA_ENA_SHIFT)) & GINT_PORT_ENA_ENA_MASK)
2825/*! @} */
2826
2827/* The count of GINT_PORT_ENA */
2828#define GINT_PORT_ENA_COUNT (2U)
2829
2830
2831/*!
2832 * @}
2833 */ /* end of group GINT_Register_Masks */
2834
2835
2836/* GINT - Peripheral instance base addresses */
2837/** Peripheral GINT0 base address */
2838#define GINT0_BASE (0x40002000u)
2839/** Peripheral GINT0 base pointer */
2840#define GINT0 ((GINT_Type *)GINT0_BASE)
2841/** Peripheral GINT1 base address */
2842#define GINT1_BASE (0x40003000u)
2843/** Peripheral GINT1 base pointer */
2844#define GINT1 ((GINT_Type *)GINT1_BASE)
2845/** Array initializer of GINT peripheral base addresses */
2846#define GINT_BASE_ADDRS { GINT0_BASE, GINT1_BASE }
2847/** Array initializer of GINT peripheral base pointers */
2848#define GINT_BASE_PTRS { GINT0, GINT1 }
2849/** Interrupt vectors for the GINT peripheral type */
2850#define GINT_IRQS { GINT0_IRQn, GINT1_IRQn }
2851
2852/*!
2853 * @}
2854 */ /* end of group GINT_Peripheral_Access_Layer */
2855
2856
2857/* ----------------------------------------------------------------------------
2858 -- GPIO Peripheral Access Layer
2859 ---------------------------------------------------------------------------- */
2860
2861/*!
2862 * @addtogroup GPIO_Peripheral_Access_Layer GPIO Peripheral Access Layer
2863 * @{
2864 */
2865
2866/** GPIO - Register Layout Typedef */
2867typedef struct {
2868 __IO uint8_t B[2][32]; /**< Byte pin registers for all port 0 and 1 GPIO pins, array offset: 0x0, array step: index*0x20, index2*0x1 */
2869 uint8_t RESERVED_0[4032];
2870 __IO uint32_t W[2][32]; /**< Word pin registers for all port 0 and 1 GPIO pins, array offset: 0x1000, array step: index*0x80, index2*0x4 */
2871 uint8_t RESERVED_1[3840];
2872 __IO uint32_t DIR[2]; /**< Direction registers, array offset: 0x2000, array step: 0x4 */
2873 uint8_t RESERVED_2[120];
2874 __IO uint32_t MASK[2]; /**< Mask register, array offset: 0x2080, array step: 0x4 */
2875 uint8_t RESERVED_3[120];
2876 __IO uint32_t PIN[2]; /**< Port pin register, array offset: 0x2100, array step: 0x4 */
2877 uint8_t RESERVED_4[120];
2878 __IO uint32_t MPIN[2]; /**< Masked port register, array offset: 0x2180, array step: 0x4 */
2879 uint8_t RESERVED_5[120];
2880 __IO uint32_t SET[2]; /**< Write: Set register for port Read: output bits for port, array offset: 0x2200, array step: 0x4 */
2881 uint8_t RESERVED_6[120];
2882 __O uint32_t CLR[2]; /**< Clear port, array offset: 0x2280, array step: 0x4 */
2883 uint8_t RESERVED_7[120];
2884 __O uint32_t NOT[2]; /**< Toggle port, array offset: 0x2300, array step: 0x4 */
2885 uint8_t RESERVED_8[120];
2886 __O uint32_t DIRSET[2]; /**< Set pin direction bits for port, array offset: 0x2380, array step: 0x4 */
2887 uint8_t RESERVED_9[120];
2888 __O uint32_t DIRCLR[2]; /**< Clear pin direction bits for port, array offset: 0x2400, array step: 0x4 */
2889 uint8_t RESERVED_10[120];
2890 __O uint32_t DIRNOT[2]; /**< Toggle pin direction bits for port, array offset: 0x2480, array step: 0x4 */
2891} GPIO_Type;
2892
2893/* ----------------------------------------------------------------------------
2894 -- GPIO Register Masks
2895 ---------------------------------------------------------------------------- */
2896
2897/*!
2898 * @addtogroup GPIO_Register_Masks GPIO Register Masks
2899 * @{
2900 */
2901
2902/*! @name B - Byte pin registers for all port 0 and 1 GPIO pins */
2903/*! @{ */
2904#define GPIO_B_PBYTE_MASK (0x1U)
2905#define GPIO_B_PBYTE_SHIFT (0U)
2906/*! PBYTE - Read: state of the pin PIOm_n, regardless of direction, masking, or alternate function,
2907 * except that pins configured as analog I/O always read as 0. One register for each port pin.
2908 * Supported pins depends on the specific device and package. Write: loads the pin's output bit.
2909 * One register for each port pin. Supported pins depends on the specific device and package.
2910 */
2911#define GPIO_B_PBYTE(x) (((uint8_t)(((uint8_t)(x)) << GPIO_B_PBYTE_SHIFT)) & GPIO_B_PBYTE_MASK)
2912/*! @} */
2913
2914/* The count of GPIO_B */
2915#define GPIO_B_COUNT (2U)
2916
2917/* The count of GPIO_B */
2918#define GPIO_B_COUNT2 (32U)
2919
2920/*! @name W - Word pin registers for all port 0 and 1 GPIO pins */
2921/*! @{ */
2922#define GPIO_W_PWORD_MASK (0xFFFFFFFFU)
2923#define GPIO_W_PWORD_SHIFT (0U)
2924/*! PWORD - Read 0: pin PIOm_n is LOW. Write 0: clear output bit. Read 0xFFFF FFFF: pin PIOm_n is
2925 * HIGH. Write any value 0x0000 0001 to 0xFFFF FFFF: set output bit. Only 0 or 0xFFFF FFFF can be
2926 * read. Writing any value other than 0 will set the output bit. One register for each port pin.
2927 * Supported pins depends on the specific device and package.
2928 */
2929#define GPIO_W_PWORD(x) (((uint32_t)(((uint32_t)(x)) << GPIO_W_PWORD_SHIFT)) & GPIO_W_PWORD_MASK)
2930/*! @} */
2931
2932/* The count of GPIO_W */
2933#define GPIO_W_COUNT (2U)
2934
2935/* The count of GPIO_W */
2936#define GPIO_W_COUNT2 (32U)
2937
2938/*! @name DIR - Direction registers */
2939/*! @{ */
2940#define GPIO_DIR_DIRP_MASK (0xFFFFFFFFU)
2941#define GPIO_DIR_DIRP_SHIFT (0U)
2942/*! DIRP - Selects pin direction for pin PIOm_n (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported
2943 * pins depends on the specific device and package. 0 = input. 1 = output.
2944 */
2945#define GPIO_DIR_DIRP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_DIR_DIRP_SHIFT)) & GPIO_DIR_DIRP_MASK)
2946/*! @} */
2947
2948/* The count of GPIO_DIR */
2949#define GPIO_DIR_COUNT (2U)
2950
2951/*! @name MASK - Mask register */
2952/*! @{ */
2953#define GPIO_MASK_MASKP_MASK (0xFFFFFFFFU)
2954#define GPIO_MASK_MASKP_SHIFT (0U)
2955/*! MASKP - Controls which bits corresponding to PIOm_n are active in the MPORT register (bit 0 =
2956 * PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on the specific device and package. 0 =
2957 * Read MPORT: pin state; write MPORT: load output bit. 1 = Read MPORT: 0; write MPORT: output bit
2958 * not affected.
2959 */
2960#define GPIO_MASK_MASKP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_MASK_MASKP_SHIFT)) & GPIO_MASK_MASKP_MASK)
2961/*! @} */
2962
2963/* The count of GPIO_MASK */
2964#define GPIO_MASK_COUNT (2U)
2965
2966/*! @name PIN - Port pin register */
2967/*! @{ */
2968#define GPIO_PIN_PORT_MASK (0xFFFFFFFFU)
2969#define GPIO_PIN_PORT_SHIFT (0U)
2970/*! PORT - Reads pin states or loads output bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported
2971 * pins depends on the specific device and package. 0 = Read: pin is low; write: clear output bit.
2972 * 1 = Read: pin is high; write: set output bit.
2973 */
2974#define GPIO_PIN_PORT(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIN_PORT_SHIFT)) & GPIO_PIN_PORT_MASK)
2975/*! @} */
2976
2977/* The count of GPIO_PIN */
2978#define GPIO_PIN_COUNT (2U)
2979
2980/*! @name MPIN - Masked port register */
2981/*! @{ */
2982#define GPIO_MPIN_MPORTP_MASK (0xFFFFFFFFU)
2983#define GPIO_MPIN_MPORTP_SHIFT (0U)
2984/*! MPORTP - Masked port register (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on
2985 * the specific device and package. 0 = Read: pin is LOW and/or the corresponding bit in the MASK
2986 * register is 1; write: clear output bit if the corresponding bit in the MASK register is 0. 1
2987 * = Read: pin is HIGH and the corresponding bit in the MASK register is 0; write: set output bit
2988 * if the corresponding bit in the MASK register is 0.
2989 */
2990#define GPIO_MPIN_MPORTP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_MPIN_MPORTP_SHIFT)) & GPIO_MPIN_MPORTP_MASK)
2991/*! @} */
2992
2993/* The count of GPIO_MPIN */
2994#define GPIO_MPIN_COUNT (2U)
2995
2996/*! @name SET - Write: Set register for port Read: output bits for port */
2997/*! @{ */
2998#define GPIO_SET_SETP_MASK (0xFFFFFFFFU)
2999#define GPIO_SET_SETP_SHIFT (0U)
3000/*! SETP - Read or set output bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on
3001 * the specific device and package. 0 = Read: output bit: write: no operation. 1 = Read: output
3002 * bit; write: set output bit.
3003 */
3004#define GPIO_SET_SETP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_SET_SETP_SHIFT)) & GPIO_SET_SETP_MASK)
3005/*! @} */
3006
3007/* The count of GPIO_SET */
3008#define GPIO_SET_COUNT (2U)
3009
3010/*! @name CLR - Clear port */
3011/*! @{ */
3012#define GPIO_CLR_CLRP_MASK (0xFFFFFFFFU)
3013#define GPIO_CLR_CLRP_SHIFT (0U)
3014/*! CLRP - Clear output bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on the
3015 * specific device and package. 0 = No operation. 1 = Clear output bit.
3016 */
3017#define GPIO_CLR_CLRP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_CLR_CLRP_SHIFT)) & GPIO_CLR_CLRP_MASK)
3018/*! @} */
3019
3020/* The count of GPIO_CLR */
3021#define GPIO_CLR_COUNT (2U)
3022
3023/*! @name NOT - Toggle port */
3024/*! @{ */
3025#define GPIO_NOT_NOTP_MASK (0xFFFFFFFFU)
3026#define GPIO_NOT_NOTP_SHIFT (0U)
3027/*! NOTP - Toggle output bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on the
3028 * specific device and package. 0 = no operation. 1 = Toggle output bit.
3029 */
3030#define GPIO_NOT_NOTP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_NOT_NOTP_SHIFT)) & GPIO_NOT_NOTP_MASK)
3031/*! @} */
3032
3033/* The count of GPIO_NOT */
3034#define GPIO_NOT_COUNT (2U)
3035
3036/*! @name DIRSET - Set pin direction bits for port */
3037/*! @{ */
3038#define GPIO_DIRSET_DIRSETP_MASK (0x1FFFFFFFU)
3039#define GPIO_DIRSET_DIRSETP_SHIFT (0U)
3040/*! DIRSETP - Set direction bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on
3041 * the specific device and package. 0 = No operation. 1 = Set direction bit.
3042 */
3043#define GPIO_DIRSET_DIRSETP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_DIRSET_DIRSETP_SHIFT)) & GPIO_DIRSET_DIRSETP_MASK)
3044/*! @} */
3045
3046/* The count of GPIO_DIRSET */
3047#define GPIO_DIRSET_COUNT (2U)
3048
3049/*! @name DIRCLR - Clear pin direction bits for port */
3050/*! @{ */
3051#define GPIO_DIRCLR_DIRCLRP_MASK (0x1FFFFFFFU)
3052#define GPIO_DIRCLR_DIRCLRP_SHIFT (0U)
3053/*! DIRCLRP - Clear direction bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on
3054 * the specific device and package. 0 = No operation. 1 = Clear direction bit.
3055 */
3056#define GPIO_DIRCLR_DIRCLRP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_DIRCLR_DIRCLRP_SHIFT)) & GPIO_DIRCLR_DIRCLRP_MASK)
3057/*! @} */
3058
3059/* The count of GPIO_DIRCLR */
3060#define GPIO_DIRCLR_COUNT (2U)
3061
3062/*! @name DIRNOT - Toggle pin direction bits for port */
3063/*! @{ */
3064#define GPIO_DIRNOT_DIRNOTP_MASK (0x1FFFFFFFU)
3065#define GPIO_DIRNOT_DIRNOTP_SHIFT (0U)
3066/*! DIRNOTP - Toggle direction bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends
3067 * on the specific device and package. 0 = no operation. 1 = Toggle direction bit.
3068 */
3069#define GPIO_DIRNOT_DIRNOTP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_DIRNOT_DIRNOTP_SHIFT)) & GPIO_DIRNOT_DIRNOTP_MASK)
3070/*! @} */
3071
3072/* The count of GPIO_DIRNOT */
3073#define GPIO_DIRNOT_COUNT (2U)
3074
3075
3076/*!
3077 * @}
3078 */ /* end of group GPIO_Register_Masks */
3079
3080
3081/* GPIO - Peripheral instance base addresses */
3082/** Peripheral GPIO base address */
3083#define GPIO_BASE (0x4008C000u)
3084/** Peripheral GPIO base pointer */
3085#define GPIO ((GPIO_Type *)GPIO_BASE)
3086/** Array initializer of GPIO peripheral base addresses */
3087#define GPIO_BASE_ADDRS { GPIO_BASE }
3088/** Array initializer of GPIO peripheral base pointers */
3089#define GPIO_BASE_PTRS { GPIO }
3090
3091/*!
3092 * @}
3093 */ /* end of group GPIO_Peripheral_Access_Layer */
3094
3095
3096/* ----------------------------------------------------------------------------
3097 -- I2C Peripheral Access Layer
3098 ---------------------------------------------------------------------------- */
3099
3100/*!
3101 * @addtogroup I2C_Peripheral_Access_Layer I2C Peripheral Access Layer
3102 * @{
3103 */
3104
3105/** I2C - Register Layout Typedef */
3106typedef struct {
3107 uint8_t RESERVED_0[2048];
3108 __IO uint32_t CFG; /**< Configuration for shared functions., offset: 0x800 */
3109 __IO uint32_t STAT; /**< Status register for Master, Slave, and Monitor functions., offset: 0x804 */
3110 __IO uint32_t INTENSET; /**< Interrupt Enable Set and read register., offset: 0x808 */
3111 __O uint32_t INTENCLR; /**< Interrupt Enable Clear register., offset: 0x80C */
3112 __IO uint32_t TIMEOUT; /**< Time-out value register., offset: 0x810 */
3113 __IO uint32_t CLKDIV; /**< Clock pre-divider for the entire I2C interface. This determines what time increments are used for the MSTTIME register, and controls some timing of the Slave function., offset: 0x814 */
3114 __I uint32_t INTSTAT; /**< Interrupt Status register for Master, Slave, and Monitor functions., offset: 0x818 */
3115 uint8_t RESERVED_1[4];
3116 __IO uint32_t MSTCTL; /**< Master control register., offset: 0x820 */
3117 __IO uint32_t MSTTIME; /**< Master timing configuration., offset: 0x824 */
3118 __IO uint32_t MSTDAT; /**< Combined Master receiver and transmitter data register., offset: 0x828 */
3119 uint8_t RESERVED_2[20];
3120 __IO uint32_t SLVCTL; /**< Slave control register., offset: 0x840 */
3121 __IO uint32_t SLVDAT; /**< Combined Slave receiver and transmitter data register., offset: 0x844 */
3122 __IO uint32_t SLVADR[4]; /**< Slave address register., array offset: 0x848, array step: 0x4 */
3123 __IO uint32_t SLVQUAL0; /**< Slave Qualification for address 0., offset: 0x858 */
3124 uint8_t RESERVED_3[36];
3125 __I uint32_t MONRXDAT; /**< Monitor receiver data register., offset: 0x880 */
3126} I2C_Type;
3127
3128/* ----------------------------------------------------------------------------
3129 -- I2C Register Masks
3130 ---------------------------------------------------------------------------- */
3131
3132/*!
3133 * @addtogroup I2C_Register_Masks I2C Register Masks
3134 * @{
3135 */
3136
3137/*! @name CFG - Configuration for shared functions. */
3138/*! @{ */
3139#define I2C_CFG_MSTEN_MASK (0x1U)
3140#define I2C_CFG_MSTEN_SHIFT (0U)
3141/*! MSTEN - Master Enable. When disabled, configurations settings for the Master function are not
3142 * changed, but the Master function is internally reset.
3143 * 0b0..Disabled. The I2C Master function is disabled.
3144 * 0b1..Enabled. The I2C Master function is enabled.
3145 */
3146#define I2C_CFG_MSTEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_CFG_MSTEN_SHIFT)) & I2C_CFG_MSTEN_MASK)
3147#define I2C_CFG_SLVEN_MASK (0x2U)
3148#define I2C_CFG_SLVEN_SHIFT (1U)
3149/*! SLVEN - Slave Enable. When disabled, configurations settings for the Slave function are not
3150 * changed, but the Slave function is internally reset.
3151 * 0b0..Disabled. The I2C slave function is disabled.
3152 * 0b1..Enabled. The I2C slave function is enabled.
3153 */
3154#define I2C_CFG_SLVEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_CFG_SLVEN_SHIFT)) & I2C_CFG_SLVEN_MASK)
3155#define I2C_CFG_MONEN_MASK (0x4U)
3156#define I2C_CFG_MONEN_SHIFT (2U)
3157/*! MONEN - Monitor Enable. When disabled, configurations settings for the Monitor function are not
3158 * changed, but the Monitor function is internally reset.
3159 * 0b0..Disabled. The I2C Monitor function is disabled.
3160 * 0b1..Enabled. The I2C Monitor function is enabled.
3161 */
3162#define I2C_CFG_MONEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_CFG_MONEN_SHIFT)) & I2C_CFG_MONEN_MASK)
3163#define I2C_CFG_TIMEOUTEN_MASK (0x8U)
3164#define I2C_CFG_TIMEOUTEN_SHIFT (3U)
3165/*! TIMEOUTEN - I2C bus Time-out Enable. When disabled, the time-out function is internally reset.
3166 * 0b0..Disabled. Time-out function is disabled.
3167 * 0b1..Enabled. Time-out function is enabled. Both types of time-out flags will be generated and will cause
3168 * interrupts if they are enabled. Typically, only one time-out will be used in a system.
3169 */
3170#define I2C_CFG_TIMEOUTEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_CFG_TIMEOUTEN_SHIFT)) & I2C_CFG_TIMEOUTEN_MASK)
3171#define I2C_CFG_MONCLKSTR_MASK (0x10U)
3172#define I2C_CFG_MONCLKSTR_SHIFT (4U)
3173/*! MONCLKSTR - Monitor function Clock Stretching.
3174 * 0b0..Disabled. The Monitor function will not perform clock stretching. Software or DMA may not always be able
3175 * to read data provided by the Monitor function before it is overwritten. This mode may be used when
3176 * non-invasive monitoring is critical.
3177 * 0b1..Enabled. The Monitor function will perform clock stretching in order to ensure that software or DMA can
3178 * read all incoming data supplied by the Monitor function.
3179 */
3180#define I2C_CFG_MONCLKSTR(x) (((uint32_t)(((uint32_t)(x)) << I2C_CFG_MONCLKSTR_SHIFT)) & I2C_CFG_MONCLKSTR_MASK)
3181#define I2C_CFG_HSCAPABLE_MASK (0x20U)
3182#define I2C_CFG_HSCAPABLE_SHIFT (5U)
3183/*! HSCAPABLE - High-speed mode Capable enable. Since High Speed mode alters the way I2C pins drive
3184 * and filter, as well as the timing for certain I2C signalling, enabling High-speed mode applies
3185 * to all functions: Master, Slave, and Monitor.
3186 * 0b0..Fast-mode plus. The I 2C interface will support Standard-mode, Fast-mode, and Fast-mode Plus, to the
3187 * extent that the pin electronics support these modes. Any changes that need to be made to the pin controls,
3188 * such as changing the drive strength or filtering, must be made by software via the IOCON register associated
3189 * with each I2C pin,
3190 * 0b1..High-speed. In addition to Standard-mode, Fast-mode, and Fast-mode Plus, the I 2C interface will support
3191 * High-speed mode to the extent that the pin electronics support these modes. See Section 25.7.2.2 for more
3192 * information.
3193 */
3194#define I2C_CFG_HSCAPABLE(x) (((uint32_t)(((uint32_t)(x)) << I2C_CFG_HSCAPABLE_SHIFT)) & I2C_CFG_HSCAPABLE_MASK)
3195/*! @} */
3196
3197/*! @name STAT - Status register for Master, Slave, and Monitor functions. */
3198/*! @{ */
3199#define I2C_STAT_MSTPENDING_MASK (0x1U)
3200#define I2C_STAT_MSTPENDING_SHIFT (0U)
3201/*! MSTPENDING - Master Pending. Indicates that the Master is waiting to continue communication on
3202 * the I2C-bus (pending) or is idle. When the master is pending, the MSTSTATE bits indicate what
3203 * type of software service if any the master expects. This flag will cause an interrupt when set
3204 * if, enabled via the INTENSET register. The MSTPENDING flag is not set when the DMA is handling
3205 * an event (if the MSTDMA bit in the MSTCTL register is set). If the master is in the idle
3206 * state, and no communication is needed, mask this interrupt.
3207 * 0b0..In progress. Communication is in progress and the Master function is busy and cannot currently accept a command.
3208 * 0b1..Pending. The Master function needs software service or is in the idle state. If the master is not in the
3209 * idle state, it is waiting to receive or transmit data or the NACK bit.
3210 */
3211#define I2C_STAT_MSTPENDING(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_MSTPENDING_SHIFT)) & I2C_STAT_MSTPENDING_MASK)
3212#define I2C_STAT_MSTSTATE_MASK (0xEU)
3213#define I2C_STAT_MSTSTATE_SHIFT (1U)
3214/*! MSTSTATE - Master State code. The master state code reflects the master state when the
3215 * MSTPENDING bit is set, tha