aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005')
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/LPC54S005.h17823
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/LPC54S005_features.h344
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/arm/LPC540xx_MT25QL128.FLMbin0 -> 630100 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/arm/LPC540xx_MX25L12835FM2I.FLMbin0 -> 630208 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/arm/LPC540xx_W25Q128JVFM.FLMbin0 -> 630144 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/drivers/driver_reset.cmake14
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/drivers/fsl_clock.c2817
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/drivers/fsl_clock.h1294
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/drivers/fsl_inputmux_connections.h205
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/drivers/fsl_power.c20
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/drivers/fsl_power.h225
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/drivers/fsl_reset.c132
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/drivers/fsl_reset.h279
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/fsl_device_registers.h34
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/gcc/LPC54S005_ram.ld215
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/gcc/libpower_hardabi.abin0 -> 24930 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/gcc/libpower_softabi.abin0 -> 24926 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/gcc/startup_LPC54S005.S929
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/mcuxpresso/libpower_hardabi.abin0 -> 24930 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/mcuxpresso/libpower_softabi.abin0 -> 24926 bytes
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/mcuxpresso/startup_lpc54s005.c835
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/mcuxpresso/startup_lpc54s005.cpp835
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/project_template/board.c40
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/project_template/board.h121
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/project_template/clock_config.c89
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/project_template/clock_config.h68
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/project_template/peripherals.c51
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/project_template/peripherals.h34
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/project_template/pin_mux.c61
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/project_template/pin_mux.h52
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/system_LPC54S005.c364
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/system_LPC54S005.h108
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/template/RTE_Device.h281
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/utilities/fsl_notifier.c209
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/utilities/fsl_notifier.h237
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/utilities/fsl_shell.c1085
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/utilities/fsl_shell.h292
37 files changed, 29093 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/LPC54S005.h b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/LPC54S005.h
new file mode 100644
index 000000000..256f64532
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54S005/LPC54S005.h
@@ -0,0 +1,17823 @@
1/*
2** ###################################################################
3** Processors: LPC54S005JBD100
4** LPC54S005JET100
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: LPC540xx/LPC54S0xx User manual Rev.0.8 5 June 2018
12** Version: rev. 1.0, 2018-04-20
13** Build: b200304
14**
15** Abstract:
16** CMSIS Peripheral Access Layer for LPC54S005
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 (2018-04-20)
29** Initial version.
30**
31** ###################################################################
32*/
33
34/*!
35 * @file LPC54S005.h
36 * @version 1.0
37 * @date 2018-04-20
38 * @brief CMSIS Peripheral Access Layer for LPC54S005
39 *
40 * CMSIS Peripheral Access Layer for LPC54S005
41 */
42
43#ifndef _LPC54S005_H_
44#define _LPC54S005_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 75 /**< 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-M4 SV Hard Fault Interrupt */
72 MemoryManagement_IRQn = -12, /**< Cortex-M4 Memory Management Interrupt */
73 BusFault_IRQn = -11, /**< Cortex-M4 Bus Fault Interrupt */
74 UsageFault_IRQn = -10, /**< Cortex-M4 Usage Fault Interrupt */
75 SVCall_IRQn = -5, /**< Cortex-M4 SV Call Interrupt */
76 DebugMonitor_IRQn = -4, /**< Cortex-M4 Debug Monitor Interrupt */
77 PendSV_IRQn = -2, /**< Cortex-M4 Pend SV Interrupt */
78 SysTick_IRQn = -1, /**< Cortex-M4 System Tick Interrupt */
79
80 /* Device specific interrupts */
81 WDT_BOD_IRQn = 0, /**< Windowed watchdog timer, Brownout detect */
82 DMA0_IRQn = 1, /**< DMA controller */
83 GINT0_IRQn = 2, /**< GPIO group 0 */
84 GINT1_IRQn = 3, /**< GPIO group 1 */
85 PIN_INT0_IRQn = 4, /**< Pin interrupt 0 or pattern match engine slice 0 */
86 PIN_INT1_IRQn = 5, /**< Pin interrupt 1or pattern match engine slice 1 */
87 PIN_INT2_IRQn = 6, /**< Pin interrupt 2 or pattern match engine slice 2 */
88 PIN_INT3_IRQn = 7, /**< Pin interrupt 3 or pattern match engine slice 3 */
89 UTICK0_IRQn = 8, /**< Micro-tick Timer */
90 MRT0_IRQn = 9, /**< Multi-rate timer */
91 CTIMER0_IRQn = 10, /**< Standard counter/timer CTIMER0 */
92 CTIMER1_IRQn = 11, /**< Standard counter/timer CTIMER1 */
93 SCT0_IRQn = 12, /**< SCTimer/PWM */
94 CTIMER3_IRQn = 13, /**< Standard counter/timer CTIMER3 */
95 FLEXCOMM0_IRQn = 14, /**< Flexcomm Interface 0 (USART, SPI, I2C, FLEXCOMM) */
96 FLEXCOMM1_IRQn = 15, /**< Flexcomm Interface 1 (USART, SPI, I2C, FLEXCOMM) */
97 FLEXCOMM2_IRQn = 16, /**< Flexcomm Interface 2 (USART, SPI, I2C, FLEXCOMM) */
98 FLEXCOMM3_IRQn = 17, /**< Flexcomm Interface 3 (USART, SPI, I2C, FLEXCOMM) */
99 FLEXCOMM4_IRQn = 18, /**< Flexcomm Interface 4 (USART, SPI, I2C, FLEXCOMM) */
100 FLEXCOMM5_IRQn = 19, /**< Flexcomm Interface 5 (USART, SPI, I2C,, FLEXCOMM) */
101 FLEXCOMM6_IRQn = 20, /**< Flexcomm Interface 6 (USART, SPI, I2C, I2S,, FLEXCOMM) */
102 FLEXCOMM7_IRQn = 21, /**< Flexcomm Interface 7 (USART, SPI, I2C, I2S,, FLEXCOMM) */
103 ADC0_SEQA_IRQn = 22, /**< ADC0 sequence A completion. */
104 ADC0_SEQB_IRQn = 23, /**< ADC0 sequence B completion. */
105 ADC0_THCMP_IRQn = 24, /**< ADC0 threshold compare and error. */
106 DMIC0_IRQn = 25, /**< Digital microphone and DMIC subsystem */
107 HWVAD0_IRQn = 26, /**< Hardware Voice Activity Detector */
108 USB0_NEEDCLK_IRQn = 27, /**< USB Activity Wake-up Interrupt */
109 USB0_IRQn = 28, /**< USB device */
110 RTC_IRQn = 29, /**< RTC alarm and wake-up interrupts */
111 FLEXCOMM10_IRQn = 30, /**< Flexcomm Interface 10 (SPI, FLEXCOMM) */
112 Reserved47_IRQn = 31, /**< Reserved interrupt */
113 PIN_INT4_IRQn = 32, /**< Pin interrupt 4 or pattern match engine slice 4 int */
114 PIN_INT5_IRQn = 33, /**< Pin interrupt 5 or pattern match engine slice 5 int */
115 PIN_INT6_IRQn = 34, /**< Pin interrupt 6 or pattern match engine slice 6 int */
116 PIN_INT7_IRQn = 35, /**< Pin interrupt 7 or pattern match engine slice 7 int */
117 CTIMER2_IRQn = 36, /**< Standard counter/timer CTIMER2 */
118 CTIMER4_IRQn = 37, /**< Standard counter/timer CTIMER4 */
119 RIT_IRQn = 38, /**< Repetitive Interrupt Timer */
120 SPIFI0_IRQn = 39, /**< SPI flash interface */
121 FLEXCOMM8_IRQn = 40, /**< Flexcomm Interface 8 (USART, SPI, I2C, FLEXCOMM) */
122 FLEXCOMM9_IRQn = 41, /**< Flexcomm Interface 9 (USART, SPI, I2C, FLEXCOMM) */
123 SDIO_IRQn = 42, /**< SD/MMC */
124 CAN0_IRQ0_IRQn = 43, /**< CAN0 interrupt0 */
125 CAN0_IRQ1_IRQn = 44, /**< CAN0 interrupt1 */
126 CAN1_IRQ0_IRQn = 45, /**< CAN1 interrupt0 */
127 CAN1_IRQ1_IRQn = 46, /**< CAN1 interrupt1 */
128 USB1_IRQn = 47, /**< USB1 interrupt */
129 USB1_NEEDCLK_IRQn = 48, /**< USB1 activity */
130 ETHERNET_IRQn = 49, /**< Ethernet */
131 ETHERNET_PMT_IRQn = 50, /**< Ethernet power management interrupt */
132 ETHERNET_MACLP_IRQn = 51, /**< Ethernet MAC interrupt */
133 Reserved68_IRQn = 52, /**< Reserved interrupt */
134 LCD_IRQn = 53, /**< LCD interrupt */
135 SHA_IRQn = 54, /**< SHA interrupt */
136 SMARTCARD0_IRQn = 55, /**< Smart card 0 interrupt */
137 SMARTCARD1_IRQn = 56, /**< Smart card 1 interrupt */
138 Reserved73_IRQn = 57, /**< Reserved interrupt */
139 PUF_IRQn = 58 /**< PUF interrupt */
140} IRQn_Type;
141
142/*!
143 * @}
144 */ /* end of group Interrupt_vector_numbers */
145
146
147/* ----------------------------------------------------------------------------
148 -- Cortex M4 Core Configuration
149 ---------------------------------------------------------------------------- */
150
151/*!
152 * @addtogroup Cortex_Core_Configuration Cortex M4 Core Configuration
153 * @{
154 */
155
156#define __MPU_PRESENT 1 /**< Defines if an MPU is present or not */
157#define __NVIC_PRIO_BITS 3 /**< Number of priority bits implemented in the NVIC */
158#define __Vendor_SysTickConfig 0 /**< Vendor specific implementation of SysTickConfig is defined */
159#define __FPU_PRESENT 1 /**< Defines if an FPU is present or not */
160
161#include "core_cm4.h" /* Core Peripheral Access Layer */
162#include "system_LPC54S005.h" /* Device specific configuration file */
163
164/*!
165 * @}
166 */ /* end of group Cortex_Core_Configuration */
167
168
169/* ----------------------------------------------------------------------------
170 -- Mapping Information
171 ---------------------------------------------------------------------------- */
172
173/*!
174 * @addtogroup Mapping_Information Mapping Information
175 * @{
176 */
177
178/** Mapping Information */
179/*!
180 * @addtogroup dma_request
181 * @{
182 */
183
184/*******************************************************************************
185 * Definitions
186 ******************************************************************************/
187
188/*!
189 * @brief Structure for the DMA hardware request
190 *
191 * Defines the structure for the DMA hardware request collections. The user can configure the
192 * hardware request to trigger the DMA transfer accordingly. The index
193 * of the hardware request varies according to the to SoC.
194 */
195typedef enum _dma_request_source
196{
197 kDmaRequestFlexcomm0Rx = 0U, /**< Flexcomm Interface 0 RX/I2C Slave */
198 kDmaRequestFlexcomm0Tx = 1U, /**< Flexcomm Interface 0 TX/I2C Master */
199 kDmaRequestFlexcomm1Rx = 2U, /**< Flexcomm Interface 1 RX/I2C Slave */
200 kDmaRequestFlexcomm1Tx = 3U, /**< Flexcomm Interface 1 TX/I2C Master */
201 kDmaRequestFlexcomm2Rx = 4U, /**< Flexcomm Interface 2 RX/I2C Slave */
202 kDmaRequestFlexcomm2Tx = 5U, /**< Flexcomm Interface 2 TX/I2C Master */
203 kDmaRequestFlexcomm3Rx = 6U, /**< Flexcomm Interface 3 RX/I2C Slave */
204 kDmaRequestFlexcomm3Tx = 7U, /**< Flexcomm Interface 3 TX/I2C Master */
205 kDmaRequestFlexcomm4Rx = 8U, /**< Flexcomm Interface 4 RX/I2C Slave */
206 kDmaRequestFlexcomm4Tx = 9U, /**< Flexcomm Interface 4 TX/I2C Master */
207 kDmaRequestFlexcomm5Rx = 10U, /**< Flexcomm Interface 5 RX/I2C Slave */
208 kDmaRequestFlexcomm5Tx = 11U, /**< Flexcomm Interface 5 TX/I2C Master */
209 kDmaRequestFlexcomm6Rx = 12U, /**< Flexcomm Interface 6 RX/I2C Slave */
210 kDmaRequestFlexcomm6Tx = 13U, /**< Flexcomm Interface 6 TX/I2C Master */
211 kDmaRequestFlexcomm7Rx = 14U, /**< Flexcomm Interface 7 RX/I2C Slave */
212 kDmaRequestFlexcomm7Tx = 15U, /**< Flexcomm Interface 7 TX/I2C Master */
213 kDmaRequestDMIC0 = 16U, /**< Digital microphone interface 0 channel 0 */
214 kDmaRequestDMIC1 = 17U, /**< Digital microphone interface 0 channel 1 */
215 kDmaRequestSPIFI = 18U, /**< SPI Flash Interface */
216 kDmaRequestSHA = 19U, /**< Secure Hash Algorithm */
217 kDmaRequestFlexcomm8Rx = 20U, /**< Flexcomm Interface 8 RX/I2C Slave */
218 kDmaRequestFlexcomm8Tx = 21U, /**< Flexcomm Interface 8 TX/I2C Slave */
219 kDmaRequestFlexcomm9Rx = 22U, /**< Flexcomm Interface 9 RX/I2C Slave */
220 kDmaRequestFlexcomm9Tx = 23U, /**< Flexcomm Interface 9 TX/I2C Slave */
221 kDmaRequestSMARTCARD0_RX = 24U, /**< SMARTCARD0 RX */
222 kDmaRequestSMARTCARD0_TX = 25U, /**< SMARTCARD0 TX */
223 kDmaRequestSMARTCARD1_RX = 26U, /**< SMARTCARD1 RX */
224 kDmaRequestSMARTCARD1_TX = 27U, /**< SMARTCARD1 TX */
225 kDmaRequestFlexcomm10Rx = 28U, /**< Flexcomm Interface 10 RX */
226 kDmaRequestFlexcomm10Tx = 29U, /**< Flexcomm Interface 10 TX */
227} dma_request_source_t;
228
229/* @} */
230
231
232/*!
233 * @}
234 */ /* end of group Mapping_Information */
235
236
237/* ----------------------------------------------------------------------------
238 -- Device Peripheral Access Layer
239 ---------------------------------------------------------------------------- */
240
241/*!
242 * @addtogroup Peripheral_access_layer Device Peripheral Access Layer
243 * @{
244 */
245
246
247/*
248** Start of section using anonymous unions
249*/
250
251#if defined(__ARMCC_VERSION)
252 #if (__ARMCC_VERSION >= 6010050)
253 #pragma clang diagnostic push
254 #else
255 #pragma push
256 #pragma anon_unions
257 #endif
258#elif defined(__GNUC__)
259 /* anonymous unions are enabled by default */
260#elif defined(__IAR_SYSTEMS_ICC__)
261 #pragma language=extended
262#else
263 #error Not supported compiler type
264#endif
265
266/* ----------------------------------------------------------------------------
267 -- ADC Peripheral Access Layer
268 ---------------------------------------------------------------------------- */
269
270/*!
271 * @addtogroup ADC_Peripheral_Access_Layer ADC Peripheral Access Layer
272 * @{
273 */
274
275/** ADC - Register Layout Typedef */
276typedef struct {
277 __IO uint32_t CTRL; /**< ADC Control register. Contains the clock divide value, resolution selection, sampling time selection, and mode controls., offset: 0x0 */
278 __IO uint32_t INSEL; /**< Input Select. Allows selection of the temperature sensor as an alternate input to ADC channel 0., offset: 0x4 */
279 __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 */
280 __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 */
281 uint8_t RESERVED_0[8];
282 __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 */
283 __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 */
284 __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 */
285 __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 */
286 __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 */
287 __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 */
288 __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 */
289 __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 */
290 __IO uint32_t STARTUP; /**< ADC Startup register., offset: 0x6C */
291 __IO uint32_t CALIB; /**< ADC Calibration register., offset: 0x70 */
292} ADC_Type;
293
294/* ----------------------------------------------------------------------------
295 -- ADC Register Masks
296 ---------------------------------------------------------------------------- */
297
298/*!
299 * @addtogroup ADC_Register_Masks ADC Register Masks
300 * @{
301 */
302
303/*! @name CTRL - ADC Control register. Contains the clock divide value, resolution selection, sampling time selection, and mode controls. */
304/*! @{ */
305#define ADC_CTRL_CLKDIV_MASK (0xFFU)
306#define ADC_CTRL_CLKDIV_SHIFT (0U)
307/*! CLKDIV - In synchronous mode only, the system clock is divided by this value plus one to produce
308 * the clock for the ADC converter, which should be less than or equal to 72 MHz. Typically,
309 * software should program the smallest value in this field that yields this maximum clock rate or
310 * slightly less, but in certain cases (such as a high-impedance analog source) a slower clock may
311 * be desirable. This field is ignored in the asynchronous operating mode.
312 */
313#define ADC_CTRL_CLKDIV(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_CLKDIV_SHIFT)) & ADC_CTRL_CLKDIV_MASK)
314#define ADC_CTRL_ASYNMODE_MASK (0x100U)
315#define ADC_CTRL_ASYNMODE_SHIFT (8U)
316/*! ASYNMODE - Select clock mode.
317 * 0b0..Synchronous mode. The ADC clock is derived from the system clock based on the divide value selected in
318 * the CLKDIV field. The ADC clock will be started in a controlled fashion in response to a trigger to
319 * eliminate any uncertainty in the launching of an ADC conversion in response to any synchronous (on-chip) trigger.
320 * In Synchronous mode with the SYNCBYPASS bit (in a sequence control register) set, sampling of the ADC
321 * input and start of conversion will initiate 2 system clocks after the leading edge of a (synchronous) trigger
322 * pulse.
323 * 0b1..Asynchronous mode. The ADC clock is based on the output of the ADC clock divider ADCCLKSEL in the SYSCON block.
324 */
325#define ADC_CTRL_ASYNMODE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_ASYNMODE_SHIFT)) & ADC_CTRL_ASYNMODE_MASK)
326#define ADC_CTRL_RESOL_MASK (0x600U)
327#define ADC_CTRL_RESOL_SHIFT (9U)
328/*! RESOL - The number of bits of ADC resolution. Accuracy can be reduced to achieve higher
329 * conversion rates. A single conversion (including one conversion in a burst or sequence) requires the
330 * selected number of bits of resolution plus 3 ADC clocks. This field must only be altered when
331 * the ADC is fully idle. Changing it during any kind of ADC operation may have unpredictable
332 * results. ADC clock frequencies for various resolutions must not exceed: - 5x the system clock rate
333 * for 12-bit resolution - 4.3x the system clock rate for 10-bit resolution - 3.6x the system
334 * clock for 8-bit resolution - 3x the bus clock rate for 6-bit resolution
335 * 0b00..6-bit resolution. An ADC conversion requires 9 ADC clocks, plus any clocks specified by the TSAMP field.
336 * 0b01..8-bit resolution. An ADC conversion requires 11 ADC clocks, plus any clocks specified by the TSAMP field.
337 * 0b10..10-bit resolution. An ADC conversion requires 13 ADC clocks, plus any clocks specified by the TSAMP field.
338 * 0b11..12-bit resolution. An ADC conversion requires 15 ADC clocks, plus any clocks specified by the TSAMP field.
339 */
340#define ADC_CTRL_RESOL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_RESOL_SHIFT)) & ADC_CTRL_RESOL_MASK)
341#define ADC_CTRL_BYPASSCAL_MASK (0x800U)
342#define ADC_CTRL_BYPASSCAL_SHIFT (11U)
343/*! BYPASSCAL - Bypass Calibration. This bit may be set to avoid the need to calibrate if offset
344 * error is not a concern in the application.
345 * 0b0..Calibrate. The stored calibration value will be applied to the ADC during conversions to compensated for
346 * offset error. A calibration cycle must be performed each time the chip is powered-up. Re-calibration may
347 * be warranted periodically - especially if operating conditions have changed.
348 * 0b1..Bypass calibration. Calibration is not utilized. Less time is required when enabling the ADC -
349 * particularly following chip power-up. Attempts to launch a calibration cycle are blocked when this bit is set.
350 */
351#define ADC_CTRL_BYPASSCAL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_BYPASSCAL_SHIFT)) & ADC_CTRL_BYPASSCAL_MASK)
352#define ADC_CTRL_TSAMP_MASK (0x7000U)
353#define ADC_CTRL_TSAMP_SHIFT (12U)
354/*! TSAMP - Sample Time. The default sampling period (TSAMP = '000') at the start of each conversion
355 * is 2.5 ADC clock periods. Depending on a variety of factors, including operating conditions
356 * and the output impedance of the analog source, longer sampling times may be required. See
357 * Section 28.7.10. The TSAMP field specifies the number of additional ADC clock cycles, from zero to
358 * seven, by which the sample period will be extended. The total conversion time will increase by
359 * the same number of clocks. 000 - The sample period will be the default 2.5 ADC clocks. A
360 * complete conversion with 12-bits of accuracy will require 15 clocks. 001- The sample period will
361 * be extended by one ADC clock to a total of 3.5 clock periods. A complete 12-bit conversion will
362 * require 16 clocks. 010 - The sample period will be extended by two clocks to 4.5 ADC clock
363 * cycles. A complete 12-bit conversion will require 17 ADC clocks. 111 - The sample period will be
364 * extended by seven clocks to 9.5 ADC clock cycles. A complete 12-bit conversion will require
365 * 22 ADC clocks.
366 */
367#define ADC_CTRL_TSAMP(x) (((uint32_t)(((uint32_t)(x)) << ADC_CTRL_TSAMP_SHIFT)) & ADC_CTRL_TSAMP_MASK)
368/*! @} */
369
370/*! @name INSEL - Input Select. Allows selection of the temperature sensor as an alternate input to ADC channel 0. */
371/*! @{ */
372#define ADC_INSEL_SEL_MASK (0x3U)
373#define ADC_INSEL_SEL_SHIFT (0U)
374/*! SEL - Selects the input source for channel 0. All other values are reserved.
375 * 0b00..ADC0_IN0 function.
376 * 0b11..Internal temperature sensor.
377 */
378#define ADC_INSEL_SEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_INSEL_SEL_SHIFT)) & ADC_INSEL_SEL_MASK)
379/*! @} */
380
381/*! @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. */
382/*! @{ */
383#define ADC_SEQ_CTRL_CHANNELS_MASK (0xFFFU)
384#define ADC_SEQ_CTRL_CHANNELS_SHIFT (0U)
385/*! CHANNELS - Selects which one or more of the ADC channels will be sampled and converted when this
386 * sequence is launched. A 1 in any bit of this field will cause the corresponding channel to be
387 * included in the conversion sequence, where bit 0 corresponds to channel 0, bit 1 to channel 1
388 * and so forth. When this conversion sequence is triggered, either by a hardware trigger or via
389 * software command, ADC conversions will be performed on each enabled channel, in sequence,
390 * beginning with the lowest-ordered channel. This field can ONLY be changed while SEQA_ENA (bit 31)
391 * is LOW. It is allowed to change this field and set bit 31 in the same write.
392 */
393#define ADC_SEQ_CTRL_CHANNELS(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_CHANNELS_SHIFT)) & ADC_SEQ_CTRL_CHANNELS_MASK)
394#define ADC_SEQ_CTRL_TRIGGER_MASK (0x3F000U)
395#define ADC_SEQ_CTRL_TRIGGER_SHIFT (12U)
396/*! TRIGGER - Selects which of the available hardware trigger sources will cause this conversion
397 * sequence to be initiated. Program the trigger input number in this field. See Table 476. In order
398 * to avoid generating a spurious trigger, it is recommended writing to this field only when
399 * SEQA_ENA (bit 31) is low. It is safe to change this field and set bit 31 in the same write.
400 */
401#define ADC_SEQ_CTRL_TRIGGER(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_TRIGGER_SHIFT)) & ADC_SEQ_CTRL_TRIGGER_MASK)
402#define ADC_SEQ_CTRL_TRIGPOL_MASK (0x40000U)
403#define ADC_SEQ_CTRL_TRIGPOL_SHIFT (18U)
404/*! TRIGPOL - Select the polarity of the selected input trigger for this conversion sequence. In
405 * order to avoid generating a spurious trigger, it is recommended writing to this field only when
406 * SEQA_ENA (bit 31) is low. It is safe to change this field and set bit 31 in the same write.
407 * 0b0..Negative edge. A negative edge launches the conversion sequence on the selected trigger input.
408 * 0b1..Positive edge. A positive edge launches the conversion sequence on the selected trigger input.
409 */
410#define ADC_SEQ_CTRL_TRIGPOL(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_TRIGPOL_SHIFT)) & ADC_SEQ_CTRL_TRIGPOL_MASK)
411#define ADC_SEQ_CTRL_SYNCBYPASS_MASK (0x80000U)
412#define ADC_SEQ_CTRL_SYNCBYPASS_SHIFT (19U)
413/*! SYNCBYPASS - Setting this bit allows the hardware trigger input to bypass synchronization
414 * flip-flop stages and therefore shorten the time between the trigger input signal and the start of a
415 * conversion. There are slightly different criteria for whether or not this bit can be set
416 * depending on the clock operating mode: Synchronous mode (the ASYNMODE in the CTRL register = 0):
417 * Synchronization may be bypassed (this bit may be set) if the selected trigger source is already
418 * synchronous with the main system clock (eg. coming from an on-chip, system-clock-based timer).
419 * Whether this bit is set or not, a trigger pulse must be maintained for at least one system
420 * clock period. Asynchronous mode (the ASYNMODE in the CTRL register = 1): Synchronization may be
421 * bypassed (this bit may be set) if it is certain that the duration of a trigger input pulse
422 * will be at least one cycle of the ADC clock (regardless of whether the trigger comes from and
423 * on-chip or off-chip source). If this bit is NOT set, the trigger pulse must at least be
424 * maintained for one system clock period.
425 * 0b0..Enable trigger synchronization. The hardware trigger bypass is not enabled.
426 * 0b1..Bypass trigger synchronization. The hardware trigger bypass is enabled.
427 */
428#define ADC_SEQ_CTRL_SYNCBYPASS(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_SYNCBYPASS_SHIFT)) & ADC_SEQ_CTRL_SYNCBYPASS_MASK)
429#define ADC_SEQ_CTRL_START_MASK (0x4000000U)
430#define ADC_SEQ_CTRL_START_SHIFT (26U)
431/*! START - Writing a 1 to this field will launch one pass through this conversion sequence. The
432 * behavior will be identical to a sequence triggered by a hardware trigger. Do not write 1 to this
433 * bit if the BURST bit is set. This bit is only set to a 1 momentarily when written to launch a
434 * conversion sequence. It will consequently always read back as a zero.
435 */
436#define ADC_SEQ_CTRL_START(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_START_SHIFT)) & ADC_SEQ_CTRL_START_MASK)
437#define ADC_SEQ_CTRL_BURST_MASK (0x8000000U)
438#define ADC_SEQ_CTRL_BURST_SHIFT (27U)
439/*! BURST - Writing a 1 to this bit will cause this conversion sequence to be continuously cycled
440 * through. Other sequence A triggers will be ignored while this bit is set. Repeated conversions
441 * can be halted by clearing this bit. The sequence currently in progress will be completed before
442 * conversions are terminated. Note that a new sequence could begin just before BURST is cleared.
443 */
444#define ADC_SEQ_CTRL_BURST(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_BURST_SHIFT)) & ADC_SEQ_CTRL_BURST_MASK)
445#define ADC_SEQ_CTRL_SINGLESTEP_MASK (0x10000000U)
446#define ADC_SEQ_CTRL_SINGLESTEP_SHIFT (28U)
447/*! SINGLESTEP - When this bit is set, a hardware trigger or a write to the START bit will launch a
448 * single conversion on the next channel in the sequence instead of the default response of
449 * launching an entire sequence of conversions. Once all of the channels comprising a sequence have
450 * been converted, a subsequent trigger will repeat the sequence beginning with the first enabled
451 * channel. Interrupt generation will still occur either after each individual conversion or at
452 * the end of the entire sequence, depending on the state of the MODE bit.
453 */
454#define ADC_SEQ_CTRL_SINGLESTEP(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_SINGLESTEP_SHIFT)) & ADC_SEQ_CTRL_SINGLESTEP_MASK)
455#define ADC_SEQ_CTRL_LOWPRIO_MASK (0x20000000U)
456#define ADC_SEQ_CTRL_LOWPRIO_SHIFT (29U)
457/*! LOWPRIO - Set priority for sequence A.
458 * 0b0..Low priority. Any B trigger which occurs while an A conversion sequence is active will be ignored and lost.
459 * 0b1..High priority. Setting this bit to a 1 will permit any enabled B sequence trigger (including a B sequence
460 * software start) to immediately interrupt sequence A and launch a B sequence in it's place. The conversion
461 * currently in progress will be terminated. The A sequence that was interrupted will automatically resume
462 * after the B sequence completes. The channel whose conversion was terminated will be re-sampled and the
463 * conversion sequence will resume from that point.
464 */
465#define ADC_SEQ_CTRL_LOWPRIO(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_LOWPRIO_SHIFT)) & ADC_SEQ_CTRL_LOWPRIO_MASK)
466#define ADC_SEQ_CTRL_MODE_MASK (0x40000000U)
467#define ADC_SEQ_CTRL_MODE_SHIFT (30U)
468/*! MODE - Indicates whether the primary method for retrieving conversion results for this sequence
469 * will be accomplished via reading the global data register (SEQA_GDAT) at the end of each
470 * conversion, or the individual channel result registers at the end of the entire sequence. Impacts
471 * when conversion-complete interrupt/DMA trigger for sequence-A will be generated and which
472 * overrun conditions contribute to an overrun interrupt as described below.
473 * 0b0..End of conversion. The sequence A interrupt/DMA trigger will be set at the end of each individual ADC
474 * conversion performed under sequence A. This flag will mirror the DATAVALID bit in the SEQA_GDAT register. The
475 * OVERRUN bit in the SEQA_GDAT register will contribute to generation of an overrun interrupt/DMA trigger
476 * if enabled.
477 * 0b1..End of sequence. The sequence A interrupt/DMA trigger will be set when the entire set of sequence-A
478 * conversions completes. This flag will need to be explicitly cleared by software or by the DMA-clear signal in
479 * this mode. The OVERRUN bit in the SEQA_GDAT register will NOT contribute to generation of an overrun
480 * interrupt/DMA trigger since it is assumed this register may not be utilized in this mode.
481 */
482#define ADC_SEQ_CTRL_MODE(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_MODE_SHIFT)) & ADC_SEQ_CTRL_MODE_MASK)
483#define ADC_SEQ_CTRL_SEQ_ENA_MASK (0x80000000U)
484#define ADC_SEQ_CTRL_SEQ_ENA_SHIFT (31U)
485/*! SEQ_ENA - Sequence Enable. In order to avoid spuriously triggering the sequence, care should be
486 * taken to only set the SEQn_ENA bit when the selected trigger input is in its INACTIVE state
487 * (as defined by the TRIGPOL bit). If this condition is not met, the sequence will be triggered
488 * immediately upon being enabled. In order to avoid spuriously triggering the sequence, care
489 * should be taken to only set the SEQn_ENA bit when the selected trigger input is in its INACTIVE
490 * state (as defined by the TRIGPOL bit). If this condition is not met, the sequence will be
491 * triggered immediately upon being enabled.
492 * 0b0..Disabled. Sequence n is disabled. Sequence n triggers are ignored. If this bit is cleared while sequence
493 * n is in progress, the sequence will be halted at the end of the current conversion. After the sequence is
494 * re-enabled, a new trigger will be required to restart the sequence beginning with the next enabled channel.
495 * 0b1..Enabled. Sequence n is enabled.
496 */
497#define ADC_SEQ_CTRL_SEQ_ENA(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_CTRL_SEQ_ENA_SHIFT)) & ADC_SEQ_CTRL_SEQ_ENA_MASK)
498/*! @} */
499
500/* The count of ADC_SEQ_CTRL */
501#define ADC_SEQ_CTRL_COUNT (2U)
502
503/*! @name SEQ_GDAT - ADC Sequence-n Global Data register. This register contains the result of the most recent ADC conversion performed under sequence-n. */
504/*! @{ */
505#define ADC_SEQ_GDAT_RESULT_MASK (0xFFF0U)
506#define ADC_SEQ_GDAT_RESULT_SHIFT (4U)
507/*! RESULT - This field contains the 12-bit ADC conversion result from the most recent conversion
508 * performed under conversion sequence associated with this register. The result is a binary
509 * fraction representing the voltage on the currently-selected input channel as it falls within the
510 * range of VREFP to VREFN. Zero in the field indicates that the voltage on the input pin was less
511 * than, equal to, or close to that on VREFN, while 0xFFF indicates that the voltage on the input
512 * was close to, equal to, or greater than that on VREFP. DATAVALID = 1 indicates that this
513 * result has not yet been read.
514 */
515#define ADC_SEQ_GDAT_RESULT(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_GDAT_RESULT_SHIFT)) & ADC_SEQ_GDAT_RESULT_MASK)
516#define ADC_SEQ_GDAT_THCMPRANGE_MASK (0x30000U)
517#define ADC_SEQ_GDAT_THCMPRANGE_SHIFT (16U)
518/*! THCMPRANGE - Indicates whether the result of the last conversion performed was above, below or
519 * within the range established by the designated threshold comparison registers (THRn_LOW and
520 * THRn_HIGH).
521 */
522#define ADC_SEQ_GDAT_THCMPRANGE(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_GDAT_THCMPRANGE_SHIFT)) & ADC_SEQ_GDAT_THCMPRANGE_MASK)
523#define ADC_SEQ_GDAT_THCMPCROSS_MASK (0xC0000U)
524#define ADC_SEQ_GDAT_THCMPCROSS_SHIFT (18U)
525/*! THCMPCROSS - Indicates whether the result of the last conversion performed represented a
526 * crossing of the threshold level established by the designated LOW threshold comparison register
527 * (THRn_LOW) and, if so, in what direction the crossing occurred.
528 */
529#define ADC_SEQ_GDAT_THCMPCROSS(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_GDAT_THCMPCROSS_SHIFT)) & ADC_SEQ_GDAT_THCMPCROSS_MASK)
530#define ADC_SEQ_GDAT_CHN_MASK (0x3C000000U)
531#define ADC_SEQ_GDAT_CHN_SHIFT (26U)
532/*! CHN - These bits contain the channel from which the RESULT bits were converted (e.g. 0000
533 * identifies channel 0, 0001 channel 1, etc.).
534 */
535#define ADC_SEQ_GDAT_CHN(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_GDAT_CHN_SHIFT)) & ADC_SEQ_GDAT_CHN_MASK)
536#define ADC_SEQ_GDAT_OVERRUN_MASK (0x40000000U)
537#define ADC_SEQ_GDAT_OVERRUN_SHIFT (30U)
538/*! OVERRUN - This bit is set if a new conversion result is loaded into the RESULT field before a
539 * previous result has been read - i.e. while the DATAVALID bit is set. This bit is cleared, along
540 * with the DATAVALID bit, whenever this register is read. This bit will contribute to an overrun
541 * interrupt/DMA trigger if the MODE bit (in SEQAA_CTRL) for the corresponding sequence is set
542 * to '0' (and if the overrun interrupt is enabled).
543 */
544#define ADC_SEQ_GDAT_OVERRUN(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_GDAT_OVERRUN_SHIFT)) & ADC_SEQ_GDAT_OVERRUN_MASK)
545#define ADC_SEQ_GDAT_DATAVALID_MASK (0x80000000U)
546#define ADC_SEQ_GDAT_DATAVALID_SHIFT (31U)
547/*! DATAVALID - This bit is set to '1' at the end of each conversion when a new result is loaded
548 * into the RESULT field. It is cleared whenever this register is read. This bit will cause a
549 * conversion-complete interrupt for the corresponding sequence if the MODE bit (in SEQA_CTRL) for that
550 * sequence is set to 0 (and if the interrupt is enabled).
551 */
552#define ADC_SEQ_GDAT_DATAVALID(x) (((uint32_t)(((uint32_t)(x)) << ADC_SEQ_GDAT_DATAVALID_SHIFT)) & ADC_SEQ_GDAT_DATAVALID_MASK)
553/*! @} */
554
555/* The count of ADC_SEQ_GDAT */
556#define ADC_SEQ_GDAT_COUNT (2U)
557
558/*! @name DAT - ADC Channel 0 Data register. This register contains the result of the most recent conversion completed on channel 0. */
559/*! @{ */
560#define ADC_DAT_RESULT_MASK (0xFFF0U)
561#define ADC_DAT_RESULT_SHIFT (4U)
562/*! RESULT - This field contains the 12-bit ADC conversion result from the last conversion performed
563 * on this channel. This will be a binary fraction representing the voltage on the AD0[n] pin,
564 * as it falls within the range of VREFP to VREFN. Zero in the field indicates that the voltage on
565 * the input pin was less than, equal to, or close to that on VREFN, while 0xFFF indicates that
566 * the voltage on the input was close to, equal to, or greater than that on VREFP.
567 */
568#define ADC_DAT_RESULT(x) (((uint32_t)(((uint32_t)(x)) << ADC_DAT_RESULT_SHIFT)) & ADC_DAT_RESULT_MASK)
569#define ADC_DAT_THCMPRANGE_MASK (0x30000U)
570#define ADC_DAT_THCMPRANGE_SHIFT (16U)
571/*! THCMPRANGE - Threshold Range Comparison result. 0x0 = In Range: The last completed conversion
572 * was greater than or equal to the value programmed into the designated LOW threshold register
573 * (THRn_LOW) but less than or equal to the value programmed into the designated HIGH threshold
574 * register (THRn_HIGH). 0x1 = Below Range: The last completed conversion on was less than the value
575 * programmed into the designated LOW threshold register (THRn_LOW). 0x2 = Above Range: The last
576 * completed conversion was greater than the value programmed into the designated HIGH threshold
577 * register (THRn_HIGH). 0x3 = Reserved.
578 */
579#define ADC_DAT_THCMPRANGE(x) (((uint32_t)(((uint32_t)(x)) << ADC_DAT_THCMPRANGE_SHIFT)) & ADC_DAT_THCMPRANGE_MASK)
580#define ADC_DAT_THCMPCROSS_MASK (0xC0000U)
581#define ADC_DAT_THCMPCROSS_SHIFT (18U)
582/*! THCMPCROSS - Threshold Crossing Comparison result. 0x0 = No threshold Crossing detected: The
583 * most recent completed conversion on this channel had the same relationship (above or below) to
584 * the threshold value established by the designated LOW threshold register (THRn_LOW) as did the
585 * previous conversion on this channel. 0x1 = Reserved. 0x2 = Downward Threshold Crossing
586 * Detected. Indicates that a threshold crossing in the downward direction has occurred - i.e. the
587 * previous sample on this channel was above the threshold value established by the designated LOW
588 * threshold register (THRn_LOW) and the current sample is below that threshold. 0x3 = Upward
589 * Threshold Crossing Detected. Indicates that a threshold crossing in the upward direction has occurred
590 * - i.e. the previous sample on this channel was below the threshold value established by the
591 * designated LOW threshold register (THRn_LOW) and the current sample is above that threshold.
592 */
593#define ADC_DAT_THCMPCROSS(x) (((uint32_t)(((uint32_t)(x)) << ADC_DAT_THCMPCROSS_SHIFT)) & ADC_DAT_THCMPCROSS_MASK)
594#define ADC_DAT_CHANNEL_MASK (0x3C000000U)
595#define ADC_DAT_CHANNEL_SHIFT (26U)
596/*! CHANNEL - This field is hard-coded to contain the channel number that this particular register
597 * relates to (i.e. this field will contain 0b0000 for the DAT0 register, 0b0001 for the DAT1
598 * register, etc)
599 */
600#define ADC_DAT_CHANNEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_DAT_CHANNEL_SHIFT)) & ADC_DAT_CHANNEL_MASK)
601#define ADC_DAT_OVERRUN_MASK (0x40000000U)
602#define ADC_DAT_OVERRUN_SHIFT (30U)
603/*! OVERRUN - This bit will be set to a 1 if a new conversion on this channel completes and
604 * overwrites the previous contents of the RESULT field before it has been read - i.e. while the DONE bit
605 * is set. This bit is cleared, along with the DONE bit, whenever this register is read or when
606 * the data related to this channel is read from either of the global SEQn_GDAT registers. This
607 * bit (in any of the 12 registers) will cause an overrun interrupt/DMA trigger to be asserted if
608 * the overrun interrupt is enabled. While it is allowed to include the same channels in both
609 * conversion sequences, doing so may cause erratic behavior of the DONE and OVERRUN bits in the
610 * data registers associated with any of the channels that are shared between the two sequences. Any
611 * erratic OVERRUN behavior will also affect overrun interrupt generation, if enabled.
612 */
613#define ADC_DAT_OVERRUN(x) (((uint32_t)(((uint32_t)(x)) << ADC_DAT_OVERRUN_SHIFT)) & ADC_DAT_OVERRUN_MASK)
614#define ADC_DAT_DATAVALID_MASK (0x80000000U)
615#define ADC_DAT_DATAVALID_SHIFT (31U)
616/*! DATAVALID - This bit is set to 1 when an ADC conversion on this channel completes. This bit is
617 * cleared whenever this register is read or when the data related to this channel is read from
618 * either of the global SEQn_GDAT registers. While it is allowed to include the same channels in
619 * both conversion sequences, doing so may cause erratic behavior of the DONE and OVERRUN bits in
620 * the data registers associated with any of the channels that are shared between the two
621 * sequences. Any erratic OVERRUN behavior will also affect overrun interrupt generation, if enabled.
622 */
623#define ADC_DAT_DATAVALID(x) (((uint32_t)(((uint32_t)(x)) << ADC_DAT_DATAVALID_SHIFT)) & ADC_DAT_DATAVALID_MASK)
624/*! @} */
625
626/* The count of ADC_DAT */
627#define ADC_DAT_COUNT (12U)
628
629/*! @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. */
630/*! @{ */
631#define ADC_THR0_LOW_THRLOW_MASK (0xFFF0U)
632#define ADC_THR0_LOW_THRLOW_SHIFT (4U)
633/*! THRLOW - Low threshold value against which ADC results will be compared
634 */
635#define ADC_THR0_LOW_THRLOW(x) (((uint32_t)(((uint32_t)(x)) << ADC_THR0_LOW_THRLOW_SHIFT)) & ADC_THR0_LOW_THRLOW_MASK)
636/*! @} */
637
638/*! @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. */
639/*! @{ */
640#define ADC_THR1_LOW_THRLOW_MASK (0xFFF0U)
641#define ADC_THR1_LOW_THRLOW_SHIFT (4U)
642/*! THRLOW - Low threshold value against which ADC results will be compared
643 */
644#define ADC_THR1_LOW_THRLOW(x) (((uint32_t)(((uint32_t)(x)) << ADC_THR1_LOW_THRLOW_SHIFT)) & ADC_THR1_LOW_THRLOW_MASK)
645/*! @} */
646
647/*! @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. */
648/*! @{ */
649#define ADC_THR0_HIGH_THRHIGH_MASK (0xFFF0U)
650#define ADC_THR0_HIGH_THRHIGH_SHIFT (4U)
651/*! THRHIGH - High threshold value against which ADC results will be compared
652 */
653#define ADC_THR0_HIGH_THRHIGH(x) (((uint32_t)(((uint32_t)(x)) << ADC_THR0_HIGH_THRHIGH_SHIFT)) & ADC_THR0_HIGH_THRHIGH_MASK)
654/*! @} */
655
656/*! @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. */
657/*! @{ */
658#define ADC_THR1_HIGH_THRHIGH_MASK (0xFFF0U)
659#define ADC_THR1_HIGH_THRHIGH_SHIFT (4U)
660/*! THRHIGH - High threshold value against which ADC results will be compared
661 */
662#define ADC_THR1_HIGH_THRHIGH(x) (((uint32_t)(((uint32_t)(x)) << ADC_THR1_HIGH_THRHIGH_SHIFT)) & ADC_THR1_HIGH_THRHIGH_MASK)
663/*! @} */
664
665/*! @name CHAN_THRSEL - ADC Channel-Threshold Select register. Specifies which set of threshold compare registers are to be used for each channel */
666/*! @{ */
667#define ADC_CHAN_THRSEL_CH0_THRSEL_MASK (0x1U)
668#define ADC_CHAN_THRSEL_CH0_THRSEL_SHIFT (0U)
669/*! CH0_THRSEL - Threshold select for channel 0.
670 * 0b0..Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers.
671 * 0b1..Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers.
672 */
673#define ADC_CHAN_THRSEL_CH0_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH0_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH0_THRSEL_MASK)
674#define ADC_CHAN_THRSEL_CH1_THRSEL_MASK (0x2U)
675#define ADC_CHAN_THRSEL_CH1_THRSEL_SHIFT (1U)
676/*! CH1_THRSEL - Threshold select for channel 1. See description for channel 0.
677 */
678#define ADC_CHAN_THRSEL_CH1_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH1_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH1_THRSEL_MASK)
679#define ADC_CHAN_THRSEL_CH2_THRSEL_MASK (0x4U)
680#define ADC_CHAN_THRSEL_CH2_THRSEL_SHIFT (2U)
681/*! CH2_THRSEL - Threshold select for channel 2. See description for channel 0.
682 */
683#define ADC_CHAN_THRSEL_CH2_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH2_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH2_THRSEL_MASK)
684#define ADC_CHAN_THRSEL_CH3_THRSEL_MASK (0x8U)
685#define ADC_CHAN_THRSEL_CH3_THRSEL_SHIFT (3U)
686/*! CH3_THRSEL - Threshold select for channel 3. See description for channel 0.
687 */
688#define ADC_CHAN_THRSEL_CH3_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH3_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH3_THRSEL_MASK)
689#define ADC_CHAN_THRSEL_CH4_THRSEL_MASK (0x10U)
690#define ADC_CHAN_THRSEL_CH4_THRSEL_SHIFT (4U)
691/*! CH4_THRSEL - Threshold select for channel 4. See description for channel 0.
692 */
693#define ADC_CHAN_THRSEL_CH4_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH4_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH4_THRSEL_MASK)
694#define ADC_CHAN_THRSEL_CH5_THRSEL_MASK (0x20U)
695#define ADC_CHAN_THRSEL_CH5_THRSEL_SHIFT (5U)
696/*! CH5_THRSEL - Threshold select for channel 5. See description for channel 0.
697 */
698#define ADC_CHAN_THRSEL_CH5_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH5_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH5_THRSEL_MASK)
699#define ADC_CHAN_THRSEL_CH6_THRSEL_MASK (0x40U)
700#define ADC_CHAN_THRSEL_CH6_THRSEL_SHIFT (6U)
701/*! CH6_THRSEL - Threshold select for channel 6. See description for channel 0.
702 */
703#define ADC_CHAN_THRSEL_CH6_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH6_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH6_THRSEL_MASK)
704#define ADC_CHAN_THRSEL_CH7_THRSEL_MASK (0x80U)
705#define ADC_CHAN_THRSEL_CH7_THRSEL_SHIFT (7U)
706/*! CH7_THRSEL - Threshold select for channel 7. See description for channel 0.
707 */
708#define ADC_CHAN_THRSEL_CH7_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH7_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH7_THRSEL_MASK)
709#define ADC_CHAN_THRSEL_CH8_THRSEL_MASK (0x100U)
710#define ADC_CHAN_THRSEL_CH8_THRSEL_SHIFT (8U)
711/*! CH8_THRSEL - Threshold select for channel 8. See description for channel 0.
712 */
713#define ADC_CHAN_THRSEL_CH8_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH8_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH8_THRSEL_MASK)
714#define ADC_CHAN_THRSEL_CH9_THRSEL_MASK (0x200U)
715#define ADC_CHAN_THRSEL_CH9_THRSEL_SHIFT (9U)
716/*! CH9_THRSEL - Threshold select for channel 9. See description for channel 0.
717 */
718#define ADC_CHAN_THRSEL_CH9_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH9_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH9_THRSEL_MASK)
719#define ADC_CHAN_THRSEL_CH10_THRSEL_MASK (0x400U)
720#define ADC_CHAN_THRSEL_CH10_THRSEL_SHIFT (10U)
721/*! CH10_THRSEL - Threshold select for channel 10. See description for channel 0.
722 */
723#define ADC_CHAN_THRSEL_CH10_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH10_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH10_THRSEL_MASK)
724#define ADC_CHAN_THRSEL_CH11_THRSEL_MASK (0x800U)
725#define ADC_CHAN_THRSEL_CH11_THRSEL_SHIFT (11U)
726/*! CH11_THRSEL - Threshold select for channel 11. See description for channel 0.
727 */
728#define ADC_CHAN_THRSEL_CH11_THRSEL(x) (((uint32_t)(((uint32_t)(x)) << ADC_CHAN_THRSEL_CH11_THRSEL_SHIFT)) & ADC_CHAN_THRSEL_CH11_THRSEL_MASK)
729/*! @} */
730
731/*! @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. */
732/*! @{ */
733#define ADC_INTEN_SEQA_INTEN_MASK (0x1U)
734#define ADC_INTEN_SEQA_INTEN_SHIFT (0U)
735/*! SEQA_INTEN - Sequence A interrupt enable.
736 * 0b0..Disabled. The sequence A interrupt/DMA trigger is disabled.
737 * 0b1..Enabled. The sequence A interrupt/DMA trigger is enabled and will be asserted either upon completion of
738 * each individual conversion performed as part of sequence A, or upon completion of the entire A sequence of
739 * conversions, depending on the MODE bit in the SEQA_CTRL register.
740 */
741#define ADC_INTEN_SEQA_INTEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_SEQA_INTEN_SHIFT)) & ADC_INTEN_SEQA_INTEN_MASK)
742#define ADC_INTEN_SEQB_INTEN_MASK (0x2U)
743#define ADC_INTEN_SEQB_INTEN_SHIFT (1U)
744/*! SEQB_INTEN - Sequence B interrupt enable.
745 * 0b0..Disabled. The sequence B interrupt/DMA trigger is disabled.
746 * 0b1..Enabled. The sequence B interrupt/DMA trigger is enabled and will be asserted either upon completion of
747 * each individual conversion performed as part of sequence B, or upon completion of the entire B sequence of
748 * conversions, depending on the MODE bit in the SEQB_CTRL register.
749 */
750#define ADC_INTEN_SEQB_INTEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_SEQB_INTEN_SHIFT)) & ADC_INTEN_SEQB_INTEN_MASK)
751#define ADC_INTEN_OVR_INTEN_MASK (0x4U)
752#define ADC_INTEN_OVR_INTEN_SHIFT (2U)
753/*! OVR_INTEN - Overrun interrupt enable.
754 * 0b0..Disabled. The overrun interrupt is disabled.
755 * 0b1..Enabled. The overrun interrupt is enabled. Detection of an overrun condition on any of the 12 channel
756 * data registers will cause an overrun interrupt/DMA trigger. In addition, if the MODE bit for a particular
757 * sequence is 0, then an overrun in the global data register for that sequence will also cause this
758 * interrupt/DMA trigger to be asserted.
759 */
760#define ADC_INTEN_OVR_INTEN(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_OVR_INTEN_SHIFT)) & ADC_INTEN_OVR_INTEN_MASK)
761#define ADC_INTEN_ADCMPINTEN0_MASK (0x18U)
762#define ADC_INTEN_ADCMPINTEN0_SHIFT (3U)
763/*! ADCMPINTEN0 - Threshold comparison interrupt enable for channel 0.
764 * 0b00..Disabled.
765 * 0b01..Outside threshold.
766 * 0b10..Crossing threshold.
767 * 0b11..Reserved
768 */
769#define ADC_INTEN_ADCMPINTEN0(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN0_SHIFT)) & ADC_INTEN_ADCMPINTEN0_MASK)
770#define ADC_INTEN_ADCMPINTEN1_MASK (0x60U)
771#define ADC_INTEN_ADCMPINTEN1_SHIFT (5U)
772/*! ADCMPINTEN1 - Channel 1 threshold comparison interrupt enable. See description for channel 0.
773 */
774#define ADC_INTEN_ADCMPINTEN1(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN1_SHIFT)) & ADC_INTEN_ADCMPINTEN1_MASK)
775#define ADC_INTEN_ADCMPINTEN2_MASK (0x180U)
776#define ADC_INTEN_ADCMPINTEN2_SHIFT (7U)
777/*! ADCMPINTEN2 - Channel 2 threshold comparison interrupt enable. See description for channel 0.
778 */
779#define ADC_INTEN_ADCMPINTEN2(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN2_SHIFT)) & ADC_INTEN_ADCMPINTEN2_MASK)
780#define ADC_INTEN_ADCMPINTEN3_MASK (0x600U)
781#define ADC_INTEN_ADCMPINTEN3_SHIFT (9U)
782/*! ADCMPINTEN3 - Channel 3 threshold comparison interrupt enable. See description for channel 0.
783 */
784#define ADC_INTEN_ADCMPINTEN3(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN3_SHIFT)) & ADC_INTEN_ADCMPINTEN3_MASK)
785#define ADC_INTEN_ADCMPINTEN4_MASK (0x1800U)
786#define ADC_INTEN_ADCMPINTEN4_SHIFT (11U)
787/*! ADCMPINTEN4 - Channel 4 threshold comparison interrupt enable. See description for channel 0.
788 */
789#define ADC_INTEN_ADCMPINTEN4(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN4_SHIFT)) & ADC_INTEN_ADCMPINTEN4_MASK)
790#define ADC_INTEN_ADCMPINTEN5_MASK (0x6000U)
791#define ADC_INTEN_ADCMPINTEN5_SHIFT (13U)
792/*! ADCMPINTEN5 - Channel 5 threshold comparison interrupt enable. See description for channel 0.
793 */
794#define ADC_INTEN_ADCMPINTEN5(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN5_SHIFT)) & ADC_INTEN_ADCMPINTEN5_MASK)
795#define ADC_INTEN_ADCMPINTEN6_MASK (0x18000U)
796#define ADC_INTEN_ADCMPINTEN6_SHIFT (15U)
797/*! ADCMPINTEN6 - Channel 6 threshold comparison interrupt enable. See description for channel 0.
798 */
799#define ADC_INTEN_ADCMPINTEN6(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN6_SHIFT)) & ADC_INTEN_ADCMPINTEN6_MASK)
800#define ADC_INTEN_ADCMPINTEN7_MASK (0x60000U)
801#define ADC_INTEN_ADCMPINTEN7_SHIFT (17U)
802/*! ADCMPINTEN7 - Channel 7 threshold comparison interrupt enable. See description for channel 0.
803 */
804#define ADC_INTEN_ADCMPINTEN7(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN7_SHIFT)) & ADC_INTEN_ADCMPINTEN7_MASK)
805#define ADC_INTEN_ADCMPINTEN8_MASK (0x180000U)
806#define ADC_INTEN_ADCMPINTEN8_SHIFT (19U)
807/*! ADCMPINTEN8 - Channel 8 threshold comparison interrupt enable. See description for channel 0.
808 */
809#define ADC_INTEN_ADCMPINTEN8(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN8_SHIFT)) & ADC_INTEN_ADCMPINTEN8_MASK)
810#define ADC_INTEN_ADCMPINTEN9_MASK (0x600000U)
811#define ADC_INTEN_ADCMPINTEN9_SHIFT (21U)
812/*! ADCMPINTEN9 - Channel 9 threshold comparison interrupt enable. See description for channel 0.
813 */
814#define ADC_INTEN_ADCMPINTEN9(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN9_SHIFT)) & ADC_INTEN_ADCMPINTEN9_MASK)
815#define ADC_INTEN_ADCMPINTEN10_MASK (0x1800000U)
816#define ADC_INTEN_ADCMPINTEN10_SHIFT (23U)
817/*! ADCMPINTEN10 - Channel 10 threshold comparison interrupt enable. See description for channel 0.
818 */
819#define ADC_INTEN_ADCMPINTEN10(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN10_SHIFT)) & ADC_INTEN_ADCMPINTEN10_MASK)
820#define ADC_INTEN_ADCMPINTEN11_MASK (0x6000000U)
821#define ADC_INTEN_ADCMPINTEN11_SHIFT (25U)
822/*! ADCMPINTEN11 - Channel 21 threshold comparison interrupt enable. See description for channel 0.
823 */
824#define ADC_INTEN_ADCMPINTEN11(x) (((uint32_t)(((uint32_t)(x)) << ADC_INTEN_ADCMPINTEN11_SHIFT)) & ADC_INTEN_ADCMPINTEN11_MASK)
825/*! @} */
826
827/*! @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). */
828/*! @{ */
829#define ADC_FLAGS_THCMP0_MASK (0x1U)
830#define ADC_FLAGS_THCMP0_SHIFT (0U)
831/*! THCMP0 - Threshold comparison event on Channel 0. Set to 1 upon either an out-of-range result or
832 * a threshold-crossing result if enabled to do so in the INTEN register. This bit is cleared by
833 * writing a 1.
834 */
835#define ADC_FLAGS_THCMP0(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP0_SHIFT)) & ADC_FLAGS_THCMP0_MASK)
836#define ADC_FLAGS_THCMP1_MASK (0x2U)
837#define ADC_FLAGS_THCMP1_SHIFT (1U)
838/*! THCMP1 - Threshold comparison event on Channel 1. See description for channel 0.
839 */
840#define ADC_FLAGS_THCMP1(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP1_SHIFT)) & ADC_FLAGS_THCMP1_MASK)
841#define ADC_FLAGS_THCMP2_MASK (0x4U)
842#define ADC_FLAGS_THCMP2_SHIFT (2U)
843/*! THCMP2 - Threshold comparison event on Channel 2. See description for channel 0.
844 */
845#define ADC_FLAGS_THCMP2(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP2_SHIFT)) & ADC_FLAGS_THCMP2_MASK)
846#define ADC_FLAGS_THCMP3_MASK (0x8U)
847#define ADC_FLAGS_THCMP3_SHIFT (3U)
848/*! THCMP3 - Threshold comparison event on Channel 3. See description for channel 0.
849 */
850#define ADC_FLAGS_THCMP3(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP3_SHIFT)) & ADC_FLAGS_THCMP3_MASK)
851#define ADC_FLAGS_THCMP4_MASK (0x10U)
852#define ADC_FLAGS_THCMP4_SHIFT (4U)
853/*! THCMP4 - Threshold comparison event on Channel 4. See description for channel 0.
854 */
855#define ADC_FLAGS_THCMP4(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP4_SHIFT)) & ADC_FLAGS_THCMP4_MASK)
856#define ADC_FLAGS_THCMP5_MASK (0x20U)
857#define ADC_FLAGS_THCMP5_SHIFT (5U)
858/*! THCMP5 - Threshold comparison event on Channel 5. See description for channel 0.
859 */
860#define ADC_FLAGS_THCMP5(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP5_SHIFT)) & ADC_FLAGS_THCMP5_MASK)
861#define ADC_FLAGS_THCMP6_MASK (0x40U)
862#define ADC_FLAGS_THCMP6_SHIFT (6U)
863/*! THCMP6 - Threshold comparison event on Channel 6. See description for channel 0.
864 */
865#define ADC_FLAGS_THCMP6(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP6_SHIFT)) & ADC_FLAGS_THCMP6_MASK)
866#define ADC_FLAGS_THCMP7_MASK (0x80U)
867#define ADC_FLAGS_THCMP7_SHIFT (7U)
868/*! THCMP7 - Threshold comparison event on Channel 7. See description for channel 0.
869 */
870#define ADC_FLAGS_THCMP7(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP7_SHIFT)) & ADC_FLAGS_THCMP7_MASK)
871#define ADC_FLAGS_THCMP8_MASK (0x100U)
872#define ADC_FLAGS_THCMP8_SHIFT (8U)
873/*! THCMP8 - Threshold comparison event on Channel 8. See description for channel 0.
874 */
875#define ADC_FLAGS_THCMP8(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP8_SHIFT)) & ADC_FLAGS_THCMP8_MASK)
876#define ADC_FLAGS_THCMP9_MASK (0x200U)
877#define ADC_FLAGS_THCMP9_SHIFT (9U)
878/*! THCMP9 - Threshold comparison event on Channel 9. See description for channel 0.
879 */
880#define ADC_FLAGS_THCMP9(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP9_SHIFT)) & ADC_FLAGS_THCMP9_MASK)
881#define ADC_FLAGS_THCMP10_MASK (0x400U)
882#define ADC_FLAGS_THCMP10_SHIFT (10U)
883/*! THCMP10 - Threshold comparison event on Channel 10. See description for channel 0.
884 */
885#define ADC_FLAGS_THCMP10(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP10_SHIFT)) & ADC_FLAGS_THCMP10_MASK)
886#define ADC_FLAGS_THCMP11_MASK (0x800U)
887#define ADC_FLAGS_THCMP11_SHIFT (11U)
888/*! THCMP11 - Threshold comparison event on Channel 11. See description for channel 0.
889 */
890#define ADC_FLAGS_THCMP11(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP11_SHIFT)) & ADC_FLAGS_THCMP11_MASK)
891#define ADC_FLAGS_OVERRUN0_MASK (0x1000U)
892#define ADC_FLAGS_OVERRUN0_SHIFT (12U)
893/*! OVERRUN0 - Mirrors the OVERRRUN status flag from the result register for ADC channel 0
894 */
895#define ADC_FLAGS_OVERRUN0(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN0_SHIFT)) & ADC_FLAGS_OVERRUN0_MASK)
896#define ADC_FLAGS_OVERRUN1_MASK (0x2000U)
897#define ADC_FLAGS_OVERRUN1_SHIFT (13U)
898/*! OVERRUN1 - Mirrors the OVERRRUN status flag from the result register for ADC channel 1
899 */
900#define ADC_FLAGS_OVERRUN1(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN1_SHIFT)) & ADC_FLAGS_OVERRUN1_MASK)
901#define ADC_FLAGS_OVERRUN2_MASK (0x4000U)
902#define ADC_FLAGS_OVERRUN2_SHIFT (14U)
903/*! OVERRUN2 - Mirrors the OVERRRUN status flag from the result register for ADC channel 2
904 */
905#define ADC_FLAGS_OVERRUN2(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN2_SHIFT)) & ADC_FLAGS_OVERRUN2_MASK)
906#define ADC_FLAGS_OVERRUN3_MASK (0x8000U)
907#define ADC_FLAGS_OVERRUN3_SHIFT (15U)
908/*! OVERRUN3 - Mirrors the OVERRRUN status flag from the result register for ADC channel 3
909 */
910#define ADC_FLAGS_OVERRUN3(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN3_SHIFT)) & ADC_FLAGS_OVERRUN3_MASK)
911#define ADC_FLAGS_OVERRUN4_MASK (0x10000U)
912#define ADC_FLAGS_OVERRUN4_SHIFT (16U)
913/*! OVERRUN4 - Mirrors the OVERRRUN status flag from the result register for ADC channel 4
914 */
915#define ADC_FLAGS_OVERRUN4(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN4_SHIFT)) & ADC_FLAGS_OVERRUN4_MASK)
916#define ADC_FLAGS_OVERRUN5_MASK (0x20000U)
917#define ADC_FLAGS_OVERRUN5_SHIFT (17U)
918/*! OVERRUN5 - Mirrors the OVERRRUN status flag from the result register for ADC channel 5
919 */
920#define ADC_FLAGS_OVERRUN5(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN5_SHIFT)) & ADC_FLAGS_OVERRUN5_MASK)
921#define ADC_FLAGS_OVERRUN6_MASK (0x40000U)
922#define ADC_FLAGS_OVERRUN6_SHIFT (18U)
923/*! OVERRUN6 - Mirrors the OVERRRUN status flag from the result register for ADC channel 6
924 */
925#define ADC_FLAGS_OVERRUN6(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN6_SHIFT)) & ADC_FLAGS_OVERRUN6_MASK)
926#define ADC_FLAGS_OVERRUN7_MASK (0x80000U)
927#define ADC_FLAGS_OVERRUN7_SHIFT (19U)
928/*! OVERRUN7 - Mirrors the OVERRRUN status flag from the result register for ADC channel 7
929 */
930#define ADC_FLAGS_OVERRUN7(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN7_SHIFT)) & ADC_FLAGS_OVERRUN7_MASK)
931#define ADC_FLAGS_OVERRUN8_MASK (0x100000U)
932#define ADC_FLAGS_OVERRUN8_SHIFT (20U)
933/*! OVERRUN8 - Mirrors the OVERRRUN status flag from the result register for ADC channel 8
934 */
935#define ADC_FLAGS_OVERRUN8(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN8_SHIFT)) & ADC_FLAGS_OVERRUN8_MASK)
936#define ADC_FLAGS_OVERRUN9_MASK (0x200000U)
937#define ADC_FLAGS_OVERRUN9_SHIFT (21U)
938/*! OVERRUN9 - Mirrors the OVERRRUN status flag from the result register for ADC channel 9
939 */
940#define ADC_FLAGS_OVERRUN9(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN9_SHIFT)) & ADC_FLAGS_OVERRUN9_MASK)
941#define ADC_FLAGS_OVERRUN10_MASK (0x400000U)
942#define ADC_FLAGS_OVERRUN10_SHIFT (22U)
943/*! OVERRUN10 - Mirrors the OVERRRUN status flag from the result register for ADC channel 10
944 */
945#define ADC_FLAGS_OVERRUN10(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN10_SHIFT)) & ADC_FLAGS_OVERRUN10_MASK)
946#define ADC_FLAGS_OVERRUN11_MASK (0x800000U)
947#define ADC_FLAGS_OVERRUN11_SHIFT (23U)
948/*! OVERRUN11 - Mirrors the OVERRRUN status flag from the result register for ADC channel 11
949 */
950#define ADC_FLAGS_OVERRUN11(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVERRUN11_SHIFT)) & ADC_FLAGS_OVERRUN11_MASK)
951#define ADC_FLAGS_SEQA_OVR_MASK (0x1000000U)
952#define ADC_FLAGS_SEQA_OVR_SHIFT (24U)
953/*! SEQA_OVR - Mirrors the global OVERRUN status flag in the SEQA_GDAT register
954 */
955#define ADC_FLAGS_SEQA_OVR(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_SEQA_OVR_SHIFT)) & ADC_FLAGS_SEQA_OVR_MASK)
956#define ADC_FLAGS_SEQB_OVR_MASK (0x2000000U)
957#define ADC_FLAGS_SEQB_OVR_SHIFT (25U)
958/*! SEQB_OVR - Mirrors the global OVERRUN status flag in the SEQB_GDAT register
959 */
960#define ADC_FLAGS_SEQB_OVR(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_SEQB_OVR_SHIFT)) & ADC_FLAGS_SEQB_OVR_MASK)
961#define ADC_FLAGS_SEQA_INT_MASK (0x10000000U)
962#define ADC_FLAGS_SEQA_INT_SHIFT (28U)
963/*! SEQA_INT - Sequence A interrupt/DMA trigger. If the MODE bit in the SEQA_CTRL register is 0,
964 * this flag will mirror the DATAVALID bit in the sequence A global data register (SEQA_GDAT), which
965 * is set at the end of every ADC conversion performed as part of sequence A. It will be cleared
966 * automatically when the SEQA_GDAT register is read. If the MODE bit in the SEQA_CTRL register
967 * is 1, this flag will be set upon completion of an entire A sequence. In this case it must be
968 * cleared by writing a 1 to this SEQA_INT bit. This interrupt must be enabled in the INTEN
969 * register.
970 */
971#define ADC_FLAGS_SEQA_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_SEQA_INT_SHIFT)) & ADC_FLAGS_SEQA_INT_MASK)
972#define ADC_FLAGS_SEQB_INT_MASK (0x20000000U)
973#define ADC_FLAGS_SEQB_INT_SHIFT (29U)
974/*! SEQB_INT - Sequence A interrupt/DMA trigger. If the MODE bit in the SEQB_CTRL register is 0,
975 * this flag will mirror the DATAVALID bit in the sequence A global data register (SEQB_GDAT), which
976 * is set at the end of every ADC conversion performed as part of sequence B. It will be cleared
977 * automatically when the SEQB_GDAT register is read. If the MODE bit in the SEQB_CTRL register
978 * is 1, this flag will be set upon completion of an entire B sequence. In this case it must be
979 * cleared by writing a 1 to this SEQB_INT bit. This interrupt must be enabled in the INTEN
980 * register.
981 */
982#define ADC_FLAGS_SEQB_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_SEQB_INT_SHIFT)) & ADC_FLAGS_SEQB_INT_MASK)
983#define ADC_FLAGS_THCMP_INT_MASK (0x40000000U)
984#define ADC_FLAGS_THCMP_INT_SHIFT (30U)
985/*! THCMP_INT - Threshold Comparison Interrupt. This bit will be set if any of the THCMP flags in
986 * the lower bits of this register are set to 1 (due to an enabled out-of-range or
987 * threshold-crossing event on any channel). Each type of threshold comparison interrupt on each channel must be
988 * individually enabled in the INTEN register to cause this interrupt. This bit will be cleared
989 * when all of the individual threshold flags are cleared via writing 1s to those bits.
990 */
991#define ADC_FLAGS_THCMP_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_THCMP_INT_SHIFT)) & ADC_FLAGS_THCMP_INT_MASK)
992#define ADC_FLAGS_OVR_INT_MASK (0x80000000U)
993#define ADC_FLAGS_OVR_INT_SHIFT (31U)
994/*! OVR_INT - Overrun Interrupt flag. Any overrun bit in any of the individual channel data
995 * registers will cause this interrupt. In addition, if the MODE bit in either of the SEQn_CTRL registers
996 * is 0 then the OVERRUN bit in the corresponding SEQn_GDAT register will also cause this
997 * interrupt. This interrupt must be enabled in the INTEN register. This bit will be cleared when all
998 * of the individual overrun bits have been cleared via reading the corresponding data registers.
999 */
1000#define ADC_FLAGS_OVR_INT(x) (((uint32_t)(((uint32_t)(x)) << ADC_FLAGS_OVR_INT_SHIFT)) & ADC_FLAGS_OVR_INT_MASK)
1001/*! @} */
1002
1003/*! @name STARTUP - ADC Startup register. */
1004/*! @{ */
1005#define ADC_STARTUP_ADC_ENA_MASK (0x1U)
1006#define ADC_STARTUP_ADC_ENA_SHIFT (0U)
1007/*! ADC_ENA - ADC Enable bit. This bit can only be set to a 1 by software. It is cleared
1008 * automatically whenever the ADC is powered down. This bit must not be set until at least 10 microseconds
1009 * after the ADC is powered up (typically by altering a system-level ADC power control bit).
1010 */
1011#define ADC_STARTUP_ADC_ENA(x) (((uint32_t)(((uint32_t)(x)) << ADC_STARTUP_ADC_ENA_SHIFT)) & ADC_STARTUP_ADC_ENA_MASK)
1012#define ADC_STARTUP_ADC_INIT_MASK (0x2U)
1013#define ADC_STARTUP_ADC_INIT_SHIFT (1U)
1014/*! ADC_INIT - ADC Initialization. After enabling the ADC (setting the ADC_ENA bit), the API routine
1015 * will EITHER set this bit or the CALIB bit in the CALIB register, depending on whether or not
1016 * calibration is required. Setting this bit will launch the 'dummy' conversion cycle that is
1017 * required if a calibration is not performed. It will also reload the stored calibration value from
1018 * a previous calibration unless the BYPASSCAL bit is set. This bit should only be set AFTER the
1019 * ADC_ENA bit is set and after the CALIREQD bit is tested to determine whether a calibration or
1020 * an ADC dummy conversion cycle is required. It should not be set during the same write that
1021 * sets the ADC_ENA bit. This bit can only be set to a '1' by software. It is cleared automatically
1022 * when the 'dummy' conversion cycle completes.
1023 */
1024#define ADC_STARTUP_ADC_INIT(x) (((uint32_t)(((uint32_t)(x)) << ADC_STARTUP_ADC_INIT_SHIFT)) & ADC_STARTUP_ADC_INIT_MASK)
1025/*! @} */
1026
1027/*! @name CALIB - ADC Calibration register. */
1028/*! @{ */
1029#define ADC_CALIB_CALIB_MASK (0x1U)
1030#define ADC_CALIB_CALIB_SHIFT (0U)
1031/*! CALIB - Calibration request. Setting this bit will launch an ADC calibration cycle. This bit can
1032 * only be set to a '1' by software. It is cleared automatically when the calibration cycle
1033 * completes.
1034 */
1035#define ADC_CALIB_CALIB(x) (((uint32_t)(((uint32_t)(x)) << ADC_CALIB_CALIB_SHIFT)) & ADC_CALIB_CALIB_MASK)
1036#define ADC_CALIB_CALREQD_MASK (0x2U)
1037#define ADC_CALIB_CALREQD_SHIFT (1U)
1038/*! CALREQD - Calibration required. This read-only bit indicates if calibration is required when
1039 * enabling the ADC. CALREQD will be '1' if no calibration has been run since the chip was
1040 * powered-up and if the BYPASSCAL bit in the CTRL register is low. Software will test this bit to
1041 * determine whether to initiate a calibration cycle or whether to set the ADC_INIT bit (in the STARTUP
1042 * register) to launch the ADC initialization process which includes a 'dummy' conversion cycle.
1043 * Note: A 'dummy' conversion cycle requires approximately 6 ADC clocks as opposed to 81 clocks
1044 * required for calibration.
1045 */
1046#define ADC_CALIB_CALREQD(x) (((uint32_t)(((uint32_t)(x)) << ADC_CALIB_CALREQD_SHIFT)) & ADC_CALIB_CALREQD_MASK)
1047#define ADC_CALIB_CALVALUE_MASK (0x1FCU)
1048#define ADC_CALIB_CALVALUE_SHIFT (2U)
1049/*! CALVALUE - Calibration Value. This read-only field displays the calibration value established
1050 * during last calibration cycle. This value is not typically of any use to the user.
1051 */
1052#define ADC_CALIB_CALVALUE(x) (((uint32_t)(((uint32_t)(x)) << ADC_CALIB_CALVALUE_SHIFT)) & ADC_CALIB_CALVALUE_MASK)
1053/*! @} */
1054
1055
1056/*!
1057 * @}
1058 */ /* end of group ADC_Register_Masks */
1059
1060
1061/* ADC - Peripheral instance base addresses */
1062/** Peripheral ADC0 base address */
1063#define ADC0_BASE (0x400A0000u)
1064/** Peripheral ADC0 base pointer */
1065#define ADC0 ((ADC_Type *)ADC0_BASE)
1066/** Array initializer of ADC peripheral base addresses */
1067#define ADC_BASE_ADDRS { ADC0_BASE }
1068/** Array initializer of ADC peripheral base pointers */
1069#define ADC_BASE_PTRS { ADC0 }
1070/** Interrupt vectors for the ADC peripheral type */
1071#define ADC_SEQ_IRQS { ADC0_SEQA_IRQn, ADC0_SEQB_IRQn }
1072#define ADC_THCMP_IRQS { ADC0_THCMP_IRQn }
1073
1074/*!
1075 * @}
1076 */ /* end of group ADC_Peripheral_Access_Layer */
1077
1078
1079/* ----------------------------------------------------------------------------
1080 -- AES Peripheral Access Layer
1081 ---------------------------------------------------------------------------- */
1082
1083/*!
1084 * @addtogroup AES_Peripheral_Access_Layer AES Peripheral Access Layer
1085 * @{
1086 */
1087
1088/** AES - Register Layout Typedef */
1089typedef struct {
1090 union { /* offset: 0x0 */
1091 __IO uint32_t CFG; /**< AES Configuration register, offset: 0x0 */
1092 struct { /* offset: 0x0 */
1093 union { /* offset: 0x0 */
1094 __IO uint16_t CFG0_15; /**< AES Configuration register 0:15, offset: 0x0 */
1095 struct { /* offset: 0x0 */
1096 __IO uint8_t CFG0_7; /**< AES Configuration register 0:7, offset: 0x0 */
1097 __IO uint8_t CFG8_15; /**< AES Configuration register 8:15, offset: 0x1 */
1098 } CFGL;
1099 };
1100 __IO uint16_t CFG16_31; /**< AES Configuration register 16:31, offset: 0x2 */
1101 } CFG0_32;
1102 };
1103 __IO uint32_t CMD; /**< AES Command register, offset: 0x4 */
1104 __IO uint32_t STAT; /**< AES Status register, offset: 0x8 */
1105 __IO uint32_t CTR_INCR; /**< Counter Increment, offset: 0xC */
1106 uint8_t RESERVED_0[16];
1107 __O uint32_t KEY[8]; /**< Bits of the AES key, array offset: 0x20, array step: 0x4 */
1108 __O uint32_t INTEXT[4]; /**< Input text bits, array offset: 0x40, array step: 0x4 */
1109 __O uint32_t HOLDING[4]; /**< Holding register bits, array offset: 0x50, array step: 0x4 */
1110 __I uint32_t OUTTEXT[4]; /**< Output text bits, array offset: 0x60, array step: 0x4 */
1111 __O uint32_t GF128_Y[4]; /**< Y bits input of GF128 hash, array offset: 0x70, array step: 0x4 */
1112 __I uint32_t GF128_Z[4]; /**< Result bits of GF128 hash, array offset: 0x80, array step: 0x4 */
1113 __I uint32_t GCM_TAG[4]; /**< GCM Tag bits, array offset: 0x90, array step: 0x4 */
1114} AES_Type;
1115
1116/* ----------------------------------------------------------------------------
1117 -- AES Register Masks
1118 ---------------------------------------------------------------------------- */
1119
1120/*!
1121 * @addtogroup AES_Register_Masks AES Register Masks
1122 * @{
1123 */
1124
1125/*! @name CFG - AES Configuration register */
1126/*! @{ */
1127#define AES_CFG_PROC_EN_MASK (0x3U)
1128#define AES_CFG_PROC_EN_SHIFT (0U)
1129/*! PROC_EN - Process type enable.
1130 */
1131#define AES_CFG_PROC_EN(x) (((uint32_t)(((uint32_t)(x)) << AES_CFG_PROC_EN_SHIFT)) & AES_CFG_PROC_EN_MASK)
1132#define AES_CFG_GF128_SEL_MASK (0x4U)
1133#define AES_CFG_GF128_SEL_SHIFT (2U)
1134/*! GF128_SEL - GF128 hash selection.
1135 */
1136#define AES_CFG_GF128_SEL(x) (((uint32_t)(((uint32_t)(x)) << AES_CFG_GF128_SEL_SHIFT)) & AES_CFG_GF128_SEL_MASK)
1137#define AES_CFG_INTEXT_BSWAP_MASK (0x10U)
1138#define AES_CFG_INTEXT_BSWAP_SHIFT (4U)
1139/*! INTEXT_BSWAP - Byte swap input text.
1140 */
1141#define AES_CFG_INTEXT_BSWAP(x) (((uint32_t)(((uint32_t)(x)) << AES_CFG_INTEXT_BSWAP_SHIFT)) & AES_CFG_INTEXT_BSWAP_MASK)
1142#define AES_CFG_INTEXT_WSWAP_MASK (0x20U)
1143#define AES_CFG_INTEXT_WSWAP_SHIFT (5U)
1144/*! INTEXT_WSWAP - Word swap input text.
1145 */
1146#define AES_CFG_INTEXT_WSWAP(x) (((uint32_t)(((uint32_t)(x)) << AES_CFG_INTEXT_WSWAP_SHIFT)) & AES_CFG_INTEXT_WSWAP_MASK)
1147#define AES_CFG_OUTTEXT_BSWAP_MASK (0x40U)
1148#define AES_CFG_OUTTEXT_BSWAP_SHIFT (6U)
1149/*! OUTTEXT_BSWAP - Byte swap output text.
1150 */
1151#define AES_CFG_OUTTEXT_BSWAP(x) (((uint32_t)(((uint32_t)(x)) << AES_CFG_OUTTEXT_BSWAP_SHIFT)) & AES_CFG_OUTTEXT_BSWAP_MASK)
1152#define AES_CFG_OUTTEXT_WSWAP_MASK (0x80U)
1153#define AES_CFG_OUTTEXT_WSWAP_SHIFT (7U)
1154/*! OUTTEXT_WSWAP - Word swap output text.
1155 */
1156#define AES_CFG_OUTTEXT_WSWAP(x) (((uint32_t)(((uint32_t)(x)) << AES_CFG_OUTTEXT_WSWAP_SHIFT)) & AES_CFG_OUTTEXT_WSWAP_MASK)
1157#define AES_CFG_KEY_CFG_MASK (0x300U)
1158#define AES_CFG_KEY_CFG_SHIFT (8U)
1159/*! KEY_CFG - Key Configuration.
1160 */
1161#define AES_CFG_KEY_CFG(x) (((uint32_t)(((uint32_t)(x)) << AES_CFG_KEY_CFG_SHIFT)) & AES_CFG_KEY_CFG_MASK)
1162#define AES_CFG_INBLK_SEL_MASK (0x30000U)
1163#define AES_CFG_INBLK_SEL_SHIFT (16U)
1164/*! INBLK_SEL - Input block select.
1165 */
1166#define AES_CFG_INBLK_SEL(x) (((uint32_t)(((uint32_t)(x)) << AES_CFG_INBLK_SEL_SHIFT)) & AES_CFG_INBLK_SEL_MASK)
1167#define AES_CFG_HOLD_SEL_MASK (0x300000U)
1168#define AES_CFG_HOLD_SEL_SHIFT (20U)
1169/*! HOLD_SEL - Holding register source select.
1170 */
1171#define AES_CFG_HOLD_SEL(x) (((uint32_t)(((uint32_t)(x)) << AES_CFG_HOLD_SEL_SHIFT)) & AES_CFG_HOLD_SEL_MASK)
1172#define AES_CFG_OUTTEXT_SEL_MASK (0x3000000U)
1173#define AES_CFG_OUTTEXT_SEL_SHIFT (24U)
1174/*! OUTTEXT_SEL - Output text source select.
1175 */
1176#define AES_CFG_OUTTEXT_SEL(x) (((uint32_t)(((uint32_t)(x)) << AES_CFG_OUTTEXT_SEL_SHIFT)) & AES_CFG_OUTTEXT_SEL_MASK)
1177/*! @} */
1178
1179/*! @name CFG0_15 - AES Configuration register 0:15 */
1180/*! @{ */
1181#define AES_CFG0_15_PROC_EN_MASK (0x3U)
1182#define AES_CFG0_15_PROC_EN_SHIFT (0U)
1183/*! PROC_EN - Process type enable.
1184 */
1185#define AES_CFG0_15_PROC_EN(x) (((uint16_t)(((uint16_t)(x)) << AES_CFG0_15_PROC_EN_SHIFT)) & AES_CFG0_15_PROC_EN_MASK)
1186#define AES_CFG0_15_GF128_SEL_MASK (0x4U)
1187#define AES_CFG0_15_GF128_SEL_SHIFT (2U)
1188/*! GF128_SEL - GF128 hash selection.
1189 */
1190#define AES_CFG0_15_GF128_SEL(x) (((uint16_t)(((uint16_t)(x)) << AES_CFG0_15_GF128_SEL_SHIFT)) & AES_CFG0_15_GF128_SEL_MASK)
1191#define AES_CFG0_15_INTEXT_BSWAP_MASK (0x10U)
1192#define AES_CFG0_15_INTEXT_BSWAP_SHIFT (4U)
1193/*! INTEXT_BSWAP - Byte swap input text.
1194 */
1195#define AES_CFG0_15_INTEXT_BSWAP(x) (((uint16_t)(((uint16_t)(x)) << AES_CFG0_15_INTEXT_BSWAP_SHIFT)) & AES_CFG0_15_INTEXT_BSWAP_MASK)
1196#define AES_CFG0_15_INTEXT_WSWAP_MASK (0x20U)
1197#define AES_CFG0_15_INTEXT_WSWAP_SHIFT (5U)
1198/*! INTEXT_WSWAP - Word swap input text.
1199 */
1200#define AES_CFG0_15_INTEXT_WSWAP(x) (((uint16_t)(((uint16_t)(x)) << AES_CFG0_15_INTEXT_WSWAP_SHIFT)) & AES_CFG0_15_INTEXT_WSWAP_MASK)
1201#define AES_CFG0_15_OUTTEXT_BSWAP_MASK (0x40U)
1202#define AES_CFG0_15_OUTTEXT_BSWAP_SHIFT (6U)
1203/*! OUTTEXT_BSWAP - Byte swap output text.
1204 */
1205#define AES_CFG0_15_OUTTEXT_BSWAP(x) (((uint16_t)(((uint16_t)(x)) << AES_CFG0_15_OUTTEXT_BSWAP_SHIFT)) & AES_CFG0_15_OUTTEXT_BSWAP_MASK)
1206#define AES_CFG0_15_OUTTEXT_WSWAP_MASK (0x80U)
1207#define AES_CFG0_15_OUTTEXT_WSWAP_SHIFT (7U)
1208/*! OUTTEXT_WSWAP - Word swap output text.
1209 */
1210#define AES_CFG0_15_OUTTEXT_WSWAP(x) (((uint16_t)(((uint16_t)(x)) << AES_CFG0_15_OUTTEXT_WSWAP_SHIFT)) & AES_CFG0_15_OUTTEXT_WSWAP_MASK)
1211#define AES_CFG0_15_KEY_CFG_MASK (0x300U)
1212#define AES_CFG0_15_KEY_CFG_SHIFT (8U)
1213/*! KEY_CFG - Key Configuration.
1214 */
1215#define AES_CFG0_15_KEY_CFG(x) (((uint16_t)(((uint16_t)(x)) << AES_CFG0_15_KEY_CFG_SHIFT)) & AES_CFG0_15_KEY_CFG_MASK)
1216/*! @} */
1217
1218/*! @name CFG0_7 - AES Configuration register 0:7 */
1219/*! @{ */
1220#define AES_CFG0_7_PROC_EN_MASK (0x3U)
1221#define AES_CFG0_7_PROC_EN_SHIFT (0U)
1222/*! PROC_EN - Process type enable.
1223 */
1224#define AES_CFG0_7_PROC_EN(x) (((uint8_t)(((uint8_t)(x)) << AES_CFG0_7_PROC_EN_SHIFT)) & AES_CFG0_7_PROC_EN_MASK)
1225#define AES_CFG0_7_GF128_SEL_MASK (0x4U)
1226#define AES_CFG0_7_GF128_SEL_SHIFT (2U)
1227/*! GF128_SEL - GF128 hash selection.
1228 */
1229#define AES_CFG0_7_GF128_SEL(x) (((uint8_t)(((uint8_t)(x)) << AES_CFG0_7_GF128_SEL_SHIFT)) & AES_CFG0_7_GF128_SEL_MASK)
1230#define AES_CFG0_7_INTEXT_BSWAP_MASK (0x10U)
1231#define AES_CFG0_7_INTEXT_BSWAP_SHIFT (4U)
1232/*! INTEXT_BSWAP - Byte swap input text.
1233 */
1234#define AES_CFG0_7_INTEXT_BSWAP(x) (((uint8_t)(((uint8_t)(x)) << AES_CFG0_7_INTEXT_BSWAP_SHIFT)) & AES_CFG0_7_INTEXT_BSWAP_MASK)
1235#define AES_CFG0_7_INTEXT_WSWAP_MASK (0x20U)
1236#define AES_CFG0_7_INTEXT_WSWAP_SHIFT (5U)
1237/*! INTEXT_WSWAP - Word swap input text.
1238 */
1239#define AES_CFG0_7_INTEXT_WSWAP(x) (((uint8_t)(((uint8_t)(x)) << AES_CFG0_7_INTEXT_WSWAP_SHIFT)) & AES_CFG0_7_INTEXT_WSWAP_MASK)
1240#define AES_CFG0_7_OUTTEXT_BSWAP_MASK (0x40U)
1241#define AES_CFG0_7_OUTTEXT_BSWAP_SHIFT (6U)
1242/*! OUTTEXT_BSWAP - Byte swap output text.
1243 */
1244#define AES_CFG0_7_OUTTEXT_BSWAP(x) (((uint8_t)(((uint8_t)(x)) << AES_CFG0_7_OUTTEXT_BSWAP_SHIFT)) & AES_CFG0_7_OUTTEXT_BSWAP_MASK)
1245#define AES_CFG0_7_OUTTEXT_WSWAP_MASK (0x80U)
1246#define AES_CFG0_7_OUTTEXT_WSWAP_SHIFT (7U)
1247/*! OUTTEXT_WSWAP - Word swap output text.
1248 */
1249#define AES_CFG0_7_OUTTEXT_WSWAP(x) (((uint8_t)(((uint8_t)(x)) << AES_CFG0_7_OUTTEXT_WSWAP_SHIFT)) & AES_CFG0_7_OUTTEXT_WSWAP_MASK)
1250/*! @} */
1251
1252/*! @name CFG8_15 - AES Configuration register 8:15 */
1253/*! @{ */
1254#define AES_CFG8_15_KEY_CFG_MASK (0x3U)
1255#define AES_CFG8_15_KEY_CFG_SHIFT (0U)
1256/*! KEY_CFG - Key Configuration.
1257 */
1258#define AES_CFG8_15_KEY_CFG(x) (((uint8_t)(((uint8_t)(x)) << AES_CFG8_15_KEY_CFG_SHIFT)) & AES_CFG8_15_KEY_CFG_MASK)
1259/*! @} */
1260
1261/*! @name CFG16_31 - AES Configuration register 16:31 */
1262/*! @{ */
1263#define AES_CFG16_31_INBLK_SEL_MASK (0x3U)
1264#define AES_CFG16_31_INBLK_SEL_SHIFT (0U)
1265/*! INBLK_SEL - Input block select.
1266 */
1267#define AES_CFG16_31_INBLK_SEL(x) (((uint16_t)(((uint16_t)(x)) << AES_CFG16_31_INBLK_SEL_SHIFT)) & AES_CFG16_31_INBLK_SEL_MASK)
1268#define AES_CFG16_31_HOLD_SEL_MASK (0x30U)
1269#define AES_CFG16_31_HOLD_SEL_SHIFT (4U)
1270/*! HOLD_SEL - Holding register source select.
1271 */
1272#define AES_CFG16_31_HOLD_SEL(x) (((uint16_t)(((uint16_t)(x)) << AES_CFG16_31_HOLD_SEL_SHIFT)) & AES_CFG16_31_HOLD_SEL_MASK)
1273#define AES_CFG16_31_OUTTEXT_SEL_MASK (0x300U)
1274#define AES_CFG16_31_OUTTEXT_SEL_SHIFT (8U)
1275/*! OUTTEXT_SEL - Output text source select.
1276 */
1277#define AES_CFG16_31_OUTTEXT_SEL(x) (((uint16_t)(((uint16_t)(x)) << AES_CFG16_31_OUTTEXT_SEL_SHIFT)) & AES_CFG16_31_OUTTEXT_SEL_MASK)
1278/*! @} */
1279
1280/*! @name CMD - AES Command register */
1281/*! @{ */
1282#define AES_CMD_COPY_TO_Y_MASK (0x2U)
1283#define AES_CMD_COPY_TO_Y_SHIFT (1U)
1284/*! COPY_TO_Y - Copy output text to GF128Y.
1285 */
1286#define AES_CMD_COPY_TO_Y(x) (((uint32_t)(((uint32_t)(x)) << AES_CMD_COPY_TO_Y_SHIFT)) & AES_CMD_COPY_TO_Y_MASK)
1287#define AES_CMD_SWITCH_MODE_MASK (0x10U)
1288#define AES_CMD_SWITCH_MODE_SHIFT (4U)
1289/*! SWITCH_MODE - When this bit is set the mode switches from forward mode (encryption) to reverse
1290 * mode (decryption) or reverse mode to forward mode.
1291 */
1292#define AES_CMD_SWITCH_MODE(x) (((uint32_t)(((uint32_t)(x)) << AES_CMD_SWITCH_MODE_SHIFT)) & AES_CMD_SWITCH_MODE_MASK)
1293#define AES_CMD_ABORT_MASK (0x100U)
1294#define AES_CMD_ABORT_SHIFT (8U)
1295/*! ABORT - Aborts Encrypt/Decrypt and GF128 Hash operation.
1296 */
1297#define AES_CMD_ABORT(x) (((uint32_t)(((uint32_t)(x)) << AES_CMD_ABORT_SHIFT)) & AES_CMD_ABORT_MASK)
1298#define AES_CMD_WIPE_MASK (0x200U)
1299#define AES_CMD_WIPE_SHIFT (9U)
1300/*! WIPE - When set this bit performs abort, clears KEY and GF128_Y registers and disables cipher.
1301 */
1302#define AES_CMD_WIPE(x) (((uint32_t)(((uint32_t)(x)) << AES_CMD_WIPE_SHIFT)) & AES_CMD_WIPE_MASK)
1303/*! @} */
1304
1305/*! @name STAT - AES Status register */
1306/*! @{ */
1307#define AES_STAT_IDLE_MASK (0x1U)
1308#define AES_STAT_IDLE_SHIFT (0U)
1309/*! IDLE - AES engine Idle.
1310 */
1311#define AES_STAT_IDLE(x) (((uint32_t)(((uint32_t)(x)) << AES_STAT_IDLE_SHIFT)) & AES_STAT_IDLE_MASK)
1312#define AES_STAT_IN_READY_MASK (0x2U)
1313#define AES_STAT_IN_READY_SHIFT (1U)
1314/*! IN_READY - Input text ready.
1315 */
1316#define AES_STAT_IN_READY(x) (((uint32_t)(((uint32_t)(x)) << AES_STAT_IN_READY_SHIFT)) & AES_STAT_IN_READY_MASK)
1317#define AES_STAT_OUT_READY_MASK (0x4U)
1318#define AES_STAT_OUT_READY_SHIFT (2U)
1319/*! OUT_READY - Output text ready.
1320 */
1321#define AES_STAT_OUT_READY(x) (((uint32_t)(((uint32_t)(x)) << AES_STAT_OUT_READY_SHIFT)) & AES_STAT_OUT_READY_MASK)
1322#define AES_STAT_REVERSE_MASK (0x10U)
1323#define AES_STAT_REVERSE_SHIFT (4U)
1324/*! REVERSE - Reverse mode.
1325 */
1326#define AES_STAT_REVERSE(x) (((uint32_t)(((uint32_t)(x)) << AES_STAT_REVERSE_SHIFT)) & AES_STAT_REVERSE_MASK)
1327#define AES_STAT_KEY_VALID_MASK (0x20U)
1328#define AES_STAT_KEY_VALID_SHIFT (5U)
1329/*! KEY_VALID - Key valid.
1330 */
1331#define AES_STAT_KEY_VALID(x) (((uint32_t)(((uint32_t)(x)) << AES_STAT_KEY_VALID_SHIFT)) & AES_STAT_KEY_VALID_MASK)
1332/*! @} */
1333
1334/*! @name CTR_INCR - Counter Increment */
1335/*! @{ */
1336#define AES_CTR_INCR_CTR_INCR_MASK (0xFFFFFFFFU)
1337#define AES_CTR_INCR_CTR_INCR_SHIFT (0U)
1338/*! CTR_INCR - Increment value for HOLDING register when in counter modes.
1339 */
1340#define AES_CTR_INCR_CTR_INCR(x) (((uint32_t)(((uint32_t)(x)) << AES_CTR_INCR_CTR_INCR_SHIFT)) & AES_CTR_INCR_CTR_INCR_MASK)
1341/*! @} */
1342
1343/*! @name KEY - Bits of the AES key */
1344/*! @{ */
1345#define AES_KEY_KEY_MASK (0xFFFFFFFFU)
1346#define AES_KEY_KEY_SHIFT (0U)
1347/*! KEY - Contains the bits of the AES key.
1348 */
1349#define AES_KEY_KEY(x) (((uint32_t)(((uint32_t)(x)) << AES_KEY_KEY_SHIFT)) & AES_KEY_KEY_MASK)
1350/*! @} */
1351
1352/* The count of AES_KEY */
1353#define AES_KEY_COUNT (8U)
1354
1355/*! @name INTEXT - Input text bits */
1356/*! @{ */
1357#define AES_INTEXT_INTEXT_MASK (0xFFFFFFFFU)
1358#define AES_INTEXT_INTEXT_SHIFT (0U)
1359/*! INTEXT - Contains bits of the AES key.
1360 */
1361#define AES_INTEXT_INTEXT(x) (((uint32_t)(((uint32_t)(x)) << AES_INTEXT_INTEXT_SHIFT)) & AES_INTEXT_INTEXT_MASK)
1362/*! @} */
1363
1364/* The count of AES_INTEXT */
1365#define AES_INTEXT_COUNT (4U)
1366
1367/*! @name HOLDING - Holding register bits */
1368/*! @{ */
1369#define AES_HOLDING_HOLDING_MASK (0xFFFFFFFFU)
1370#define AES_HOLDING_HOLDING_SHIFT (0U)
1371/*! HOLDING - Contains the first word (bits 31:0) of the 128 bit Holding value.
1372 */
1373#define AES_HOLDING_HOLDING(x) (((uint32_t)(((uint32_t)(x)) << AES_HOLDING_HOLDING_SHIFT)) & AES_HOLDING_HOLDING_MASK)
1374/*! @} */
1375
1376/* The count of AES_HOLDING */
1377#define AES_HOLDING_COUNT (4U)
1378
1379/*! @name OUTTEXT - Output text bits */
1380/*! @{ */
1381#define AES_OUTTEXT_OUTTEXT_MASK (0xFFFFFFFFU)
1382#define AES_OUTTEXT_OUTTEXT_SHIFT (0U)
1383/*! OUTTEXT - Contains the bits of the 128 bit Output text data.
1384 */
1385#define AES_OUTTEXT_OUTTEXT(x) (((uint32_t)(((uint32_t)(x)) << AES_OUTTEXT_OUTTEXT_SHIFT)) & AES_OUTTEXT_OUTTEXT_MASK)
1386/*! @} */
1387
1388/* The count of AES_OUTTEXT */
1389#define AES_OUTTEXT_COUNT (4U)
1390
1391/*! @name GF128_Y - Y bits input of GF128 hash */
1392/*! @{ */
1393#define AES_GF128_Y_GF128_Y_MASK (0xFFFFFFFFU)
1394#define AES_GF128_Y_GF128_Y_SHIFT (0U)
1395/*! GF128_Y - Contains the bits of the Y input of GF128 hash.
1396 */
1397#define AES_GF128_Y_GF128_Y(x) (((uint32_t)(((uint32_t)(x)) << AES_GF128_Y_GF128_Y_SHIFT)) & AES_GF128_Y_GF128_Y_MASK)
1398/*! @} */
1399
1400/* The count of AES_GF128_Y */
1401#define AES_GF128_Y_COUNT (4U)
1402
1403/*! @name GF128_Z - Result bits of GF128 hash */
1404/*! @{ */
1405#define AES_GF128_Z_GF128_Z_MASK (0xFFFFFFFFU)
1406#define AES_GF128_Z_GF128_Z_SHIFT (0U)
1407/*! GF128_Z - Contains bits of the result of GF128 hash.
1408 */
1409#define AES_GF128_Z_GF128_Z(x) (((uint32_t)(((uint32_t)(x)) << AES_GF128_Z_GF128_Z_SHIFT)) & AES_GF128_Z_GF128_Z_MASK)
1410/*! @} */
1411
1412/* The count of AES_GF128_Z */
1413#define AES_GF128_Z_COUNT (4U)
1414
1415/*! @name GCM_TAG - GCM Tag bits */
1416/*! @{ */
1417#define AES_GCM_TAG_GCM_TAG_MASK (0xFFFFFFFFU)
1418#define AES_GCM_TAG_GCM_TAG_SHIFT (0U)
1419/*! GCM_TAG - Contains bits of the 128 bit GCM tag.
1420 */
1421#define AES_GCM_TAG_GCM_TAG(x) (((uint32_t)(((uint32_t)(x)) << AES_GCM_TAG_GCM_TAG_SHIFT)) & AES_GCM_TAG_GCM_TAG_MASK)
1422/*! @} */
1423
1424/* The count of AES_GCM_TAG */
1425#define AES_GCM_TAG_COUNT (4U)
1426
1427
1428/*!
1429 * @}
1430 */ /* end of group AES_Register_Masks */
1431
1432
1433/* AES - Peripheral instance base addresses */
1434/** Peripheral AES0 base address */
1435#define AES0_BASE (0x400A1000u)
1436/** Peripheral AES0 base pointer */
1437#define AES0 ((AES_Type *)AES0_BASE)
1438/** Array initializer of AES peripheral base addresses */
1439#define AES_BASE_ADDRS { AES0_BASE }
1440/** Array initializer of AES peripheral base pointers */
1441#define AES_BASE_PTRS { AES0 }
1442
1443/*!
1444 * @}
1445 */ /* end of group AES_Peripheral_Access_Layer */
1446
1447
1448/* ----------------------------------------------------------------------------
1449 -- ASYNC_SYSCON Peripheral Access Layer
1450 ---------------------------------------------------------------------------- */
1451
1452/*!
1453 * @addtogroup ASYNC_SYSCON_Peripheral_Access_Layer ASYNC_SYSCON Peripheral Access Layer
1454 * @{
1455 */
1456
1457/** ASYNC_SYSCON - Register Layout Typedef */
1458typedef struct {
1459 __IO uint32_t ASYNCPRESETCTRL; /**< Async peripheral reset control, offset: 0x0 */
1460 __O uint32_t ASYNCPRESETCTRLSET; /**< Set bits in ASYNCPRESETCTRL, offset: 0x4 */
1461 __O uint32_t ASYNCPRESETCTRLCLR; /**< Clear bits in ASYNCPRESETCTRL, offset: 0x8 */
1462 uint8_t RESERVED_0[4];
1463 __IO uint32_t ASYNCAPBCLKCTRL; /**< Async peripheral clock control, offset: 0x10 */
1464 __O uint32_t ASYNCAPBCLKCTRLSET; /**< Set bits in ASYNCAPBCLKCTRL, offset: 0x14 */
1465 __O uint32_t ASYNCAPBCLKCTRLCLR; /**< Clear bits in ASYNCAPBCLKCTRL, offset: 0x18 */
1466 uint8_t RESERVED_1[4];
1467 __IO uint32_t ASYNCAPBCLKSELA; /**< Async APB clock source select A, offset: 0x20 */
1468} ASYNC_SYSCON_Type;
1469
1470/* ----------------------------------------------------------------------------
1471 -- ASYNC_SYSCON Register Masks
1472 ---------------------------------------------------------------------------- */
1473
1474/*!
1475 * @addtogroup ASYNC_SYSCON_Register_Masks ASYNC_SYSCON Register Masks
1476 * @{
1477 */
1478
1479/*! @name ASYNCPRESETCTRL - Async peripheral reset control */
1480/*! @{ */
1481#define ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER3_MASK (0x2000U)
1482#define ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER3_SHIFT (13U)
1483/*! CTIMER3 - Standard counter/timer CTIMER3 reset control. 0 = Clear reset to this function. 1 = Assert reset to this function.
1484 */
1485#define ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER3(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER3_SHIFT)) & ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER3_MASK)
1486#define ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER4_MASK (0x4000U)
1487#define ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER4_SHIFT (14U)
1488/*! CTIMER4 - Standard counter/timer CTIMER4 reset control. 0 = Clear reset to this function. 1 = Assert reset to this function.
1489 */
1490#define ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER4(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER4_SHIFT)) & ASYNC_SYSCON_ASYNCPRESETCTRL_CTIMER4_MASK)
1491/*! @} */
1492
1493/*! @name ASYNCPRESETCTRLSET - Set bits in ASYNCPRESETCTRL */
1494/*! @{ */
1495#define ASYNC_SYSCON_ASYNCPRESETCTRLSET_ARST_SET_MASK (0xFFFFFFFFU)
1496#define ASYNC_SYSCON_ASYNCPRESETCTRLSET_ARST_SET_SHIFT (0U)
1497/*! ARST_SET - Writing ones to this register sets the corresponding bit or bits in the
1498 * ASYNCPRESETCTRL register, if they are implemented. Bits that do not correspond to defined bits in
1499 * ASYNCPRESETCTRL are reserved and only zeroes should be written to them.
1500 */
1501#define ASYNC_SYSCON_ASYNCPRESETCTRLSET_ARST_SET(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCPRESETCTRLSET_ARST_SET_SHIFT)) & ASYNC_SYSCON_ASYNCPRESETCTRLSET_ARST_SET_MASK)
1502/*! @} */
1503
1504/*! @name ASYNCPRESETCTRLCLR - Clear bits in ASYNCPRESETCTRL */
1505/*! @{ */
1506#define ASYNC_SYSCON_ASYNCPRESETCTRLCLR_ARST_CLR_MASK (0xFFFFFFFFU)
1507#define ASYNC_SYSCON_ASYNCPRESETCTRLCLR_ARST_CLR_SHIFT (0U)
1508/*! ARST_CLR - Writing ones to this register clears the corresponding bit or bits in the
1509 * ASYNCPRESETCTRL register, if they are implemented. Bits that do not correspond to defined bits in
1510 * ASYNCPRESETCTRL are reserved and only zeroes should be written to them.
1511 */
1512#define ASYNC_SYSCON_ASYNCPRESETCTRLCLR_ARST_CLR(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCPRESETCTRLCLR_ARST_CLR_SHIFT)) & ASYNC_SYSCON_ASYNCPRESETCTRLCLR_ARST_CLR_MASK)
1513/*! @} */
1514
1515/*! @name ASYNCAPBCLKCTRL - Async peripheral clock control */
1516/*! @{ */
1517#define ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER3_MASK (0x2000U)
1518#define ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER3_SHIFT (13U)
1519/*! CTIMER3 - Controls the clock for CTIMER3. 0 = Disable; 1 = Enable.
1520 */
1521#define ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER3(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER3_SHIFT)) & ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER3_MASK)
1522#define ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER4_MASK (0x4000U)
1523#define ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER4_SHIFT (14U)
1524/*! CTIMER4 - Controls the clock for CTIMER4. 0 = Disable; 1 = Enable.
1525 */
1526#define ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER4(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER4_SHIFT)) & ASYNC_SYSCON_ASYNCAPBCLKCTRL_CTIMER4_MASK)
1527/*! @} */
1528
1529/*! @name ASYNCAPBCLKCTRLSET - Set bits in ASYNCAPBCLKCTRL */
1530/*! @{ */
1531#define ASYNC_SYSCON_ASYNCAPBCLKCTRLSET_ACLK_SET_MASK (0xFFFFFFFFU)
1532#define ASYNC_SYSCON_ASYNCAPBCLKCTRLSET_ACLK_SET_SHIFT (0U)
1533/*! ACLK_SET - Writing ones to this register sets the corresponding bit or bits in the
1534 * ASYNCAPBCLKCTRL register, if they are implemented. Bits that do not correspond to defined bits in
1535 * ASYNCPRESETCTRL are reserved and only zeroes should be written to them.
1536 */
1537#define ASYNC_SYSCON_ASYNCAPBCLKCTRLSET_ACLK_SET(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCAPBCLKCTRLSET_ACLK_SET_SHIFT)) & ASYNC_SYSCON_ASYNCAPBCLKCTRLSET_ACLK_SET_MASK)
1538/*! @} */
1539
1540/*! @name ASYNCAPBCLKCTRLCLR - Clear bits in ASYNCAPBCLKCTRL */
1541/*! @{ */
1542#define ASYNC_SYSCON_ASYNCAPBCLKCTRLCLR_ACLK_CLR_MASK (0xFFFFFFFFU)
1543#define ASYNC_SYSCON_ASYNCAPBCLKCTRLCLR_ACLK_CLR_SHIFT (0U)
1544/*! ACLK_CLR - Writing ones to this register clears the corresponding bit or bits in the
1545 * ASYNCAPBCLKCTRL register, if they are implemented. Bits that do not correspond to defined bits in
1546 * ASYNCAPBCLKCTRL are reserved and only zeroes should be written to them.
1547 */
1548#define ASYNC_SYSCON_ASYNCAPBCLKCTRLCLR_ACLK_CLR(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCAPBCLKCTRLCLR_ACLK_CLR_SHIFT)) & ASYNC_SYSCON_ASYNCAPBCLKCTRLCLR_ACLK_CLR_MASK)
1549/*! @} */
1550
1551/*! @name ASYNCAPBCLKSELA - Async APB clock source select A */
1552/*! @{ */
1553#define ASYNC_SYSCON_ASYNCAPBCLKSELA_SEL_MASK (0x3U)
1554#define ASYNC_SYSCON_ASYNCAPBCLKSELA_SEL_SHIFT (0U)
1555/*! SEL - Clock source for asynchronous clock source selector A
1556 * 0b00..Main clock (main_clk)
1557 * 0b01..FRO 12 MHz (fro_12m)
1558 * 0b10..Audio PLL clock.(AUDPLL_BYPASS)
1559 * 0b11..fc6 fclk (fc6_fclk)
1560 */
1561#define ASYNC_SYSCON_ASYNCAPBCLKSELA_SEL(x) (((uint32_t)(((uint32_t)(x)) << ASYNC_SYSCON_ASYNCAPBCLKSELA_SEL_SHIFT)) & ASYNC_SYSCON_ASYNCAPBCLKSELA_SEL_MASK)
1562/*! @} */
1563
1564
1565/*!
1566 * @}
1567 */ /* end of group ASYNC_SYSCON_Register_Masks */
1568
1569
1570/* ASYNC_SYSCON - Peripheral instance base addresses */
1571/** Peripheral ASYNC_SYSCON base address */
1572#define ASYNC_SYSCON_BASE (0x40040000u)
1573/** Peripheral ASYNC_SYSCON base pointer */
1574#define ASYNC_SYSCON ((ASYNC_SYSCON_Type *)ASYNC_SYSCON_BASE)
1575/** Array initializer of ASYNC_SYSCON peripheral base addresses */
1576#define ASYNC_SYSCON_BASE_ADDRS { ASYNC_SYSCON_BASE }
1577/** Array initializer of ASYNC_SYSCON peripheral base pointers */
1578#define ASYNC_SYSCON_BASE_PTRS { ASYNC_SYSCON }
1579
1580/*!
1581 * @}
1582 */ /* end of group ASYNC_SYSCON_Peripheral_Access_Layer */
1583
1584
1585/* ----------------------------------------------------------------------------
1586 -- CRC Peripheral Access Layer
1587 ---------------------------------------------------------------------------- */
1588
1589/*!
1590 * @addtogroup CRC_Peripheral_Access_Layer CRC Peripheral Access Layer
1591 * @{
1592 */
1593
1594/** CRC - Register Layout Typedef */
1595typedef struct {
1596 __IO uint32_t MODE; /**< CRC mode register, offset: 0x0 */
1597 __IO uint32_t SEED; /**< CRC seed register, offset: 0x4 */
1598 union { /* offset: 0x8 */
1599 __I uint32_t SUM; /**< CRC checksum register, offset: 0x8 */
1600 __O uint32_t WR_DATA; /**< CRC data register, offset: 0x8 */
1601 };
1602} CRC_Type;
1603
1604/* ----------------------------------------------------------------------------
1605 -- CRC Register Masks
1606 ---------------------------------------------------------------------------- */
1607
1608/*!
1609 * @addtogroup CRC_Register_Masks CRC Register Masks
1610 * @{
1611 */
1612
1613/*! @name MODE - CRC mode register */
1614/*! @{ */
1615#define CRC_MODE_CRC_POLY_MASK (0x3U)
1616#define CRC_MODE_CRC_POLY_SHIFT (0U)
1617/*! CRC_POLY - CRC polynomial: 1X = CRC-32 polynomial 01 = CRC-16 polynomial 00 = CRC-CCITT polynomial
1618 */
1619#define CRC_MODE_CRC_POLY(x) (((uint32_t)(((uint32_t)(x)) << CRC_MODE_CRC_POLY_SHIFT)) & CRC_MODE_CRC_POLY_MASK)
1620#define CRC_MODE_BIT_RVS_WR_MASK (0x4U)
1621#define CRC_MODE_BIT_RVS_WR_SHIFT (2U)
1622/*! 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)
1623 */
1624#define CRC_MODE_BIT_RVS_WR(x) (((uint32_t)(((uint32_t)(x)) << CRC_MODE_BIT_RVS_WR_SHIFT)) & CRC_MODE_BIT_RVS_WR_MASK)
1625#define CRC_MODE_CMPL_WR_MASK (0x8U)
1626#define CRC_MODE_CMPL_WR_SHIFT (3U)
1627/*! CMPL_WR - Data complement: 1 = 1's complement for CRC_WR_DATA 0 = No 1's complement for CRC_WR_DATA
1628 */
1629#define CRC_MODE_CMPL_WR(x) (((uint32_t)(((uint32_t)(x)) << CRC_MODE_CMPL_WR_SHIFT)) & CRC_MODE_CMPL_WR_MASK)
1630#define CRC_MODE_BIT_RVS_SUM_MASK (0x10U)
1631#define CRC_MODE_BIT_RVS_SUM_SHIFT (4U)
1632/*! BIT_RVS_SUM - CRC sum bit order: 1 = Bit order reverse for CRC_SUM 0 = No bit order reverse for CRC_SUM
1633 */
1634#define CRC_MODE_BIT_RVS_SUM(x) (((uint32_t)(((uint32_t)(x)) << CRC_MODE_BIT_RVS_SUM_SHIFT)) & CRC_MODE_BIT_RVS_SUM_MASK)
1635#define CRC_MODE_CMPL_SUM_MASK (0x20U)
1636#define CRC_MODE_CMPL_SUM_SHIFT (5U)
1637/*! CMPL_SUM - CRC sum complement: 1 = 1's complement for CRC_SUM 0 = No 1's complement for CRC_SUM
1638 */
1639#define CRC_MODE_CMPL_SUM(x) (((uint32_t)(((uint32_t)(x)) << CRC_MODE_CMPL_SUM_SHIFT)) & CRC_MODE_CMPL_SUM_MASK)
1640/*! @} */
1641
1642/*! @name SEED - CRC seed register */
1643/*! @{ */
1644#define CRC_SEED_CRC_SEED_MASK (0xFFFFFFFFU)
1645#define CRC_SEED_CRC_SEED_SHIFT (0U)
1646/*! CRC_SEED - A write access to this register will load CRC seed value to CRC_SUM register with
1647 * selected bit order and 1's complement pre-processes. A write access to this register will
1648 * overrule the CRC calculation in progresses.
1649 */
1650#define CRC_SEED_CRC_SEED(x) (((uint32_t)(((uint32_t)(x)) << CRC_SEED_CRC_SEED_SHIFT)) & CRC_SEED_CRC_SEED_MASK)
1651/*! @} */
1652
1653/*! @name SUM - CRC checksum register */
1654/*! @{ */
1655#define CRC_SUM_CRC_SUM_MASK (0xFFFFFFFFU)
1656#define CRC_SUM_CRC_SUM_SHIFT (0U)
1657/*! CRC_SUM - The most recent CRC sum can be read through this register with selected bit order and 1's complement post-processes.
1658 */
1659#define CRC_SUM_CRC_SUM(x) (((uint32_t)(((uint32_t)(x)) << CRC_SUM_CRC_SUM_SHIFT)) & CRC_SUM_CRC_SUM_MASK)
1660/*! @} */
1661
1662/*! @name WR_DATA - CRC data register */
1663/*! @{ */
1664#define CRC_WR_DATA_CRC_WR_DATA_MASK (0xFFFFFFFFU)
1665#define CRC_WR_DATA_CRC_WR_DATA_SHIFT (0U)
1666/*! CRC_WR_DATA - Data written to this register will be taken to perform CRC calculation with
1667 * selected bit order and 1's complement pre-process. Any write size 8, 16 or 32-bit are allowed and
1668 * accept back-to-back transactions.
1669 */
1670#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)
1671/*! @} */
1672
1673
1674/*!
1675 * @}
1676 */ /* end of group CRC_Register_Masks */
1677
1678
1679/* CRC - Peripheral instance base addresses */
1680/** Peripheral CRC_ENGINE base address */
1681#define CRC_ENGINE_BASE (0x40095000u)
1682/** Peripheral CRC_ENGINE base pointer */
1683#define CRC_ENGINE ((CRC_Type *)CRC_ENGINE_BASE)
1684/** Array initializer of CRC peripheral base addresses */
1685#define CRC_BASE_ADDRS { CRC_ENGINE_BASE }
1686/** Array initializer of CRC peripheral base pointers */
1687#define CRC_BASE_PTRS { CRC_ENGINE }
1688
1689/*!
1690 * @}
1691 */ /* end of group CRC_Peripheral_Access_Layer */
1692
1693
1694/* ----------------------------------------------------------------------------
1695 -- CTIMER Peripheral Access Layer
1696 ---------------------------------------------------------------------------- */
1697
1698/*!
1699 * @addtogroup CTIMER_Peripheral_Access_Layer CTIMER Peripheral Access Layer
1700 * @{
1701 */
1702
1703/** CTIMER - Register Layout Typedef */
1704typedef struct {
1705 __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 */
1706 __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 */
1707 __IO uint32_t TC; /**< Timer Counter, offset: 0x8 */
1708 __IO uint32_t PR; /**< Prescale Register, offset: 0xC */
1709 __IO uint32_t PC; /**< Prescale Counter, offset: 0x10 */
1710 __IO uint32_t MCR; /**< Match Control Register, offset: 0x14 */
1711 __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 */
1712 __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 */
1713 __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 */
1714 __IO uint32_t EMR; /**< External Match Register. The EMR controls the match function and the external match pins., offset: 0x3C */
1715 uint8_t RESERVED_0[48];
1716 __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 */
1717 __IO uint32_t PWMC; /**< PWM Control Register. The PWMCON enables PWM mode for the external match pins., offset: 0x74 */
1718 __IO uint32_t MSR[4]; /**< Match Shadow Register, array offset: 0x78, array step: 0x4 */
1719} CTIMER_Type;
1720
1721/* ----------------------------------------------------------------------------
1722 -- CTIMER Register Masks
1723 ---------------------------------------------------------------------------- */
1724
1725/*!
1726 * @addtogroup CTIMER_Register_Masks CTIMER Register Masks
1727 * @{
1728 */
1729
1730/*! @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. */
1731/*! @{ */
1732#define CTIMER_IR_MR0INT_MASK (0x1U)
1733#define CTIMER_IR_MR0INT_SHIFT (0U)
1734/*! MR0INT - Interrupt flag for match channel 0.
1735 */
1736#define CTIMER_IR_MR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR0INT_SHIFT)) & CTIMER_IR_MR0INT_MASK)
1737#define CTIMER_IR_MR1INT_MASK (0x2U)
1738#define CTIMER_IR_MR1INT_SHIFT (1U)
1739/*! MR1INT - Interrupt flag for match channel 1.
1740 */
1741#define CTIMER_IR_MR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR1INT_SHIFT)) & CTIMER_IR_MR1INT_MASK)
1742#define CTIMER_IR_MR2INT_MASK (0x4U)
1743#define CTIMER_IR_MR2INT_SHIFT (2U)
1744/*! MR2INT - Interrupt flag for match channel 2.
1745 */
1746#define CTIMER_IR_MR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR2INT_SHIFT)) & CTIMER_IR_MR2INT_MASK)
1747#define CTIMER_IR_MR3INT_MASK (0x8U)
1748#define CTIMER_IR_MR3INT_SHIFT (3U)
1749/*! MR3INT - Interrupt flag for match channel 3.
1750 */
1751#define CTIMER_IR_MR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_MR3INT_SHIFT)) & CTIMER_IR_MR3INT_MASK)
1752#define CTIMER_IR_CR0INT_MASK (0x10U)
1753#define CTIMER_IR_CR0INT_SHIFT (4U)
1754/*! CR0INT - Interrupt flag for capture channel 0 event.
1755 */
1756#define CTIMER_IR_CR0INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR0INT_SHIFT)) & CTIMER_IR_CR0INT_MASK)
1757#define CTIMER_IR_CR1INT_MASK (0x20U)
1758#define CTIMER_IR_CR1INT_SHIFT (5U)
1759/*! CR1INT - Interrupt flag for capture channel 1 event.
1760 */
1761#define CTIMER_IR_CR1INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR1INT_SHIFT)) & CTIMER_IR_CR1INT_MASK)
1762#define CTIMER_IR_CR2INT_MASK (0x40U)
1763#define CTIMER_IR_CR2INT_SHIFT (6U)
1764/*! CR2INT - Interrupt flag for capture channel 2 event.
1765 */
1766#define CTIMER_IR_CR2INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR2INT_SHIFT)) & CTIMER_IR_CR2INT_MASK)
1767#define CTIMER_IR_CR3INT_MASK (0x80U)
1768#define CTIMER_IR_CR3INT_SHIFT (7U)
1769/*! CR3INT - Interrupt flag for capture channel 3 event.
1770 */
1771#define CTIMER_IR_CR3INT(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_IR_CR3INT_SHIFT)) & CTIMER_IR_CR3INT_MASK)
1772/*! @} */
1773
1774/*! @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. */
1775/*! @{ */
1776#define CTIMER_TCR_CEN_MASK (0x1U)
1777#define CTIMER_TCR_CEN_SHIFT (0U)
1778/*! CEN - Counter enable.
1779 * 0b0..Disabled.The counters are disabled.
1780 * 0b1..Enabled. The Timer Counter and Prescale Counter are enabled.
1781 */
1782#define CTIMER_TCR_CEN(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CEN_SHIFT)) & CTIMER_TCR_CEN_MASK)
1783#define CTIMER_TCR_CRST_MASK (0x2U)
1784#define CTIMER_TCR_CRST_SHIFT (1U)
1785/*! CRST - Counter reset.
1786 * 0b0..Disabled. Do nothing.
1787 * 0b1..Enabled. The Timer Counter and the Prescale Counter are synchronously reset on the next positive edge of
1788 * the APB bus clock. The counters remain reset until TCR[1] is returned to zero.
1789 */
1790#define CTIMER_TCR_CRST(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TCR_CRST_SHIFT)) & CTIMER_TCR_CRST_MASK)
1791/*! @} */
1792
1793/*! @name TC - Timer Counter */
1794/*! @{ */
1795#define CTIMER_TC_TCVAL_MASK (0xFFFFFFFFU)
1796#define CTIMER_TC_TCVAL_SHIFT (0U)
1797/*! TCVAL - Timer counter value.
1798 */
1799#define CTIMER_TC_TCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_TC_TCVAL_SHIFT)) & CTIMER_TC_TCVAL_MASK)
1800/*! @} */
1801
1802/*! @name PR - Prescale Register */
1803/*! @{ */
1804#define CTIMER_PR_PRVAL_MASK (0xFFFFFFFFU)
1805#define CTIMER_PR_PRVAL_SHIFT (0U)
1806/*! PRVAL - Prescale counter value.
1807 */
1808#define CTIMER_PR_PRVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PR_PRVAL_SHIFT)) & CTIMER_PR_PRVAL_MASK)
1809/*! @} */
1810
1811/*! @name PC - Prescale Counter */
1812/*! @{ */
1813#define CTIMER_PC_PCVAL_MASK (0xFFFFFFFFU)
1814#define CTIMER_PC_PCVAL_SHIFT (0U)
1815/*! PCVAL - Prescale counter value.
1816 */
1817#define CTIMER_PC_PCVAL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PC_PCVAL_SHIFT)) & CTIMER_PC_PCVAL_MASK)
1818/*! @} */
1819
1820/*! @name MCR - Match Control Register */
1821/*! @{ */
1822#define CTIMER_MCR_MR0I_MASK (0x1U)
1823#define CTIMER_MCR_MR0I_SHIFT (0U)
1824/*! MR0I - Interrupt on MR0: an interrupt is generated when MR0 matches the value in the TC.
1825 */
1826#define CTIMER_MCR_MR0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0I_SHIFT)) & CTIMER_MCR_MR0I_MASK)
1827#define CTIMER_MCR_MR0R_MASK (0x2U)
1828#define CTIMER_MCR_MR0R_SHIFT (1U)
1829/*! MR0R - Reset on MR0: the TC will be reset if MR0 matches it.
1830 */
1831#define CTIMER_MCR_MR0R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0R_SHIFT)) & CTIMER_MCR_MR0R_MASK)
1832#define CTIMER_MCR_MR0S_MASK (0x4U)
1833#define CTIMER_MCR_MR0S_SHIFT (2U)
1834/*! MR0S - Stop on MR0: the TC and PC will be stopped and TCR[0] will be set to 0 if MR0 matches the TC.
1835 */
1836#define CTIMER_MCR_MR0S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0S_SHIFT)) & CTIMER_MCR_MR0S_MASK)
1837#define CTIMER_MCR_MR1I_MASK (0x8U)
1838#define CTIMER_MCR_MR1I_SHIFT (3U)
1839/*! MR1I - Interrupt on MR1: an interrupt is generated when MR1 matches the value in the TC.
1840 */
1841#define CTIMER_MCR_MR1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1I_SHIFT)) & CTIMER_MCR_MR1I_MASK)
1842#define CTIMER_MCR_MR1R_MASK (0x10U)
1843#define CTIMER_MCR_MR1R_SHIFT (4U)
1844/*! MR1R - Reset on MR1: the TC will be reset if MR1 matches it.
1845 */
1846#define CTIMER_MCR_MR1R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1R_SHIFT)) & CTIMER_MCR_MR1R_MASK)
1847#define CTIMER_MCR_MR1S_MASK (0x20U)
1848#define CTIMER_MCR_MR1S_SHIFT (5U)
1849/*! MR1S - Stop on MR1: the TC and PC will be stopped and TCR[0] will be set to 0 if MR1 matches the TC.
1850 */
1851#define CTIMER_MCR_MR1S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1S_SHIFT)) & CTIMER_MCR_MR1S_MASK)
1852#define CTIMER_MCR_MR2I_MASK (0x40U)
1853#define CTIMER_MCR_MR2I_SHIFT (6U)
1854/*! MR2I - Interrupt on MR2: an interrupt is generated when MR2 matches the value in the TC.
1855 */
1856#define CTIMER_MCR_MR2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2I_SHIFT)) & CTIMER_MCR_MR2I_MASK)
1857#define CTIMER_MCR_MR2R_MASK (0x80U)
1858#define CTIMER_MCR_MR2R_SHIFT (7U)
1859/*! MR2R - Reset on MR2: the TC will be reset if MR2 matches it.
1860 */
1861#define CTIMER_MCR_MR2R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2R_SHIFT)) & CTIMER_MCR_MR2R_MASK)
1862#define CTIMER_MCR_MR2S_MASK (0x100U)
1863#define CTIMER_MCR_MR2S_SHIFT (8U)
1864/*! MR2S - Stop on MR2: the TC and PC will be stopped and TCR[0] will be set to 0 if MR2 matches the TC.
1865 */
1866#define CTIMER_MCR_MR2S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2S_SHIFT)) & CTIMER_MCR_MR2S_MASK)
1867#define CTIMER_MCR_MR3I_MASK (0x200U)
1868#define CTIMER_MCR_MR3I_SHIFT (9U)
1869/*! MR3I - Interrupt on MR3: an interrupt is generated when MR3 matches the value in the TC.
1870 */
1871#define CTIMER_MCR_MR3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3I_SHIFT)) & CTIMER_MCR_MR3I_MASK)
1872#define CTIMER_MCR_MR3R_MASK (0x400U)
1873#define CTIMER_MCR_MR3R_SHIFT (10U)
1874/*! MR3R - Reset on MR3: the TC will be reset if MR3 matches it.
1875 */
1876#define CTIMER_MCR_MR3R(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3R_SHIFT)) & CTIMER_MCR_MR3R_MASK)
1877#define CTIMER_MCR_MR3S_MASK (0x800U)
1878#define CTIMER_MCR_MR3S_SHIFT (11U)
1879/*! MR3S - Stop on MR3: the TC and PC will be stopped and TCR[0] will be set to 0 if MR3 matches the TC.
1880 */
1881#define CTIMER_MCR_MR3S(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3S_SHIFT)) & CTIMER_MCR_MR3S_MASK)
1882#define CTIMER_MCR_MR0RL_MASK (0x1000000U)
1883#define CTIMER_MCR_MR0RL_SHIFT (24U)
1884/*! MR0RL - Reload MR0 with the contents of the Match 0 Shadow Register when the TC is reset to zero
1885 * (either via a match event or a write to bit 1 of the TCR).
1886 */
1887#define CTIMER_MCR_MR0RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR0RL_SHIFT)) & CTIMER_MCR_MR0RL_MASK)
1888#define CTIMER_MCR_MR1RL_MASK (0x2000000U)
1889#define CTIMER_MCR_MR1RL_SHIFT (25U)
1890/*! MR1RL - Reload MR1 with the contents of the Match 1 Shadow Register when the TC is reset to zero
1891 * (either via a match event or a write to bit 1 of the TCR).
1892 */
1893#define CTIMER_MCR_MR1RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR1RL_SHIFT)) & CTIMER_MCR_MR1RL_MASK)
1894#define CTIMER_MCR_MR2RL_MASK (0x4000000U)
1895#define CTIMER_MCR_MR2RL_SHIFT (26U)
1896/*! MR2RL - Reload MR2 with the contents of the Match 2 Shadow Register when the TC is reset to zero
1897 * (either via a match event or a write to bit 1 of the TCR).
1898 */
1899#define CTIMER_MCR_MR2RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR2RL_SHIFT)) & CTIMER_MCR_MR2RL_MASK)
1900#define CTIMER_MCR_MR3RL_MASK (0x8000000U)
1901#define CTIMER_MCR_MR3RL_SHIFT (27U)
1902/*! MR3RL - Reload MR3 with the contents of the Match 3 Shadow Register when the TC is reset to zero
1903 * (either via a match event or a write to bit 1 of the TCR).
1904 */
1905#define CTIMER_MCR_MR3RL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MCR_MR3RL_SHIFT)) & CTIMER_MCR_MR3RL_MASK)
1906/*! @} */
1907
1908/*! @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. */
1909/*! @{ */
1910#define CTIMER_MR_MATCH_MASK (0xFFFFFFFFU)
1911#define CTIMER_MR_MATCH_SHIFT (0U)
1912/*! MATCH - Timer counter match value.
1913 */
1914#define CTIMER_MR_MATCH(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MR_MATCH_SHIFT)) & CTIMER_MR_MATCH_MASK)
1915/*! @} */
1916
1917/* The count of CTIMER_MR */
1918#define CTIMER_MR_COUNT (4U)
1919
1920/*! @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. */
1921/*! @{ */
1922#define CTIMER_CCR_CAP0RE_MASK (0x1U)
1923#define CTIMER_CCR_CAP0RE_SHIFT (0U)
1924/*! CAP0RE - Rising edge of capture channel 0: a sequence of 0 then 1 causes CR0 to be loaded with
1925 * the contents of TC. 0 = disabled. 1 = enabled.
1926 */
1927#define CTIMER_CCR_CAP0RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0RE_SHIFT)) & CTIMER_CCR_CAP0RE_MASK)
1928#define CTIMER_CCR_CAP0FE_MASK (0x2U)
1929#define CTIMER_CCR_CAP0FE_SHIFT (1U)
1930/*! CAP0FE - Falling edge of capture channel 0: a sequence of 1 then 0 causes CR0 to be loaded with
1931 * the contents of TC. 0 = disabled. 1 = enabled.
1932 */
1933#define CTIMER_CCR_CAP0FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0FE_SHIFT)) & CTIMER_CCR_CAP0FE_MASK)
1934#define CTIMER_CCR_CAP0I_MASK (0x4U)
1935#define CTIMER_CCR_CAP0I_SHIFT (2U)
1936/*! CAP0I - Generate interrupt on channel 0 capture event: a CR0 load generates an interrupt.
1937 */
1938#define CTIMER_CCR_CAP0I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP0I_SHIFT)) & CTIMER_CCR_CAP0I_MASK)
1939#define CTIMER_CCR_CAP1RE_MASK (0x8U)
1940#define CTIMER_CCR_CAP1RE_SHIFT (3U)
1941/*! CAP1RE - Rising edge of capture channel 1: a sequence of 0 then 1 causes CR1 to be loaded with
1942 * the contents of TC. 0 = disabled. 1 = enabled.
1943 */
1944#define CTIMER_CCR_CAP1RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1RE_SHIFT)) & CTIMER_CCR_CAP1RE_MASK)
1945#define CTIMER_CCR_CAP1FE_MASK (0x10U)
1946#define CTIMER_CCR_CAP1FE_SHIFT (4U)
1947/*! CAP1FE - Falling edge of capture channel 1: a sequence of 1 then 0 causes CR1 to be loaded with
1948 * the contents of TC. 0 = disabled. 1 = enabled.
1949 */
1950#define CTIMER_CCR_CAP1FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1FE_SHIFT)) & CTIMER_CCR_CAP1FE_MASK)
1951#define CTIMER_CCR_CAP1I_MASK (0x20U)
1952#define CTIMER_CCR_CAP1I_SHIFT (5U)
1953/*! CAP1I - Generate interrupt on channel 1 capture event: a CR1 load generates an interrupt.
1954 */
1955#define CTIMER_CCR_CAP1I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP1I_SHIFT)) & CTIMER_CCR_CAP1I_MASK)
1956#define CTIMER_CCR_CAP2RE_MASK (0x40U)
1957#define CTIMER_CCR_CAP2RE_SHIFT (6U)
1958/*! CAP2RE - Rising edge of capture channel 2: a sequence of 0 then 1 causes CR2 to be loaded with
1959 * the contents of TC. 0 = disabled. 1 = enabled.
1960 */
1961#define CTIMER_CCR_CAP2RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2RE_SHIFT)) & CTIMER_CCR_CAP2RE_MASK)
1962#define CTIMER_CCR_CAP2FE_MASK (0x80U)
1963#define CTIMER_CCR_CAP2FE_SHIFT (7U)
1964/*! CAP2FE - Falling edge of capture channel 2: a sequence of 1 then 0 causes CR2 to be loaded with
1965 * the contents of TC. 0 = disabled. 1 = enabled.
1966 */
1967#define CTIMER_CCR_CAP2FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2FE_SHIFT)) & CTIMER_CCR_CAP2FE_MASK)
1968#define CTIMER_CCR_CAP2I_MASK (0x100U)
1969#define CTIMER_CCR_CAP2I_SHIFT (8U)
1970/*! CAP2I - Generate interrupt on channel 2 capture event: a CR2 load generates an interrupt.
1971 */
1972#define CTIMER_CCR_CAP2I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP2I_SHIFT)) & CTIMER_CCR_CAP2I_MASK)
1973#define CTIMER_CCR_CAP3RE_MASK (0x200U)
1974#define CTIMER_CCR_CAP3RE_SHIFT (9U)
1975/*! CAP3RE - Rising edge of capture channel 3: a sequence of 0 then 1 causes CR3 to be loaded with
1976 * the contents of TC. 0 = disabled. 1 = enabled.
1977 */
1978#define CTIMER_CCR_CAP3RE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3RE_SHIFT)) & CTIMER_CCR_CAP3RE_MASK)
1979#define CTIMER_CCR_CAP3FE_MASK (0x400U)
1980#define CTIMER_CCR_CAP3FE_SHIFT (10U)
1981/*! CAP3FE - Falling edge of capture channel 3: a sequence of 1 then 0 causes CR3 to be loaded with
1982 * the contents of TC. 0 = disabled. 1 = enabled.
1983 */
1984#define CTIMER_CCR_CAP3FE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3FE_SHIFT)) & CTIMER_CCR_CAP3FE_MASK)
1985#define CTIMER_CCR_CAP3I_MASK (0x800U)
1986#define CTIMER_CCR_CAP3I_SHIFT (11U)
1987/*! CAP3I - Generate interrupt on channel 3 capture event: a CR3 load generates an interrupt.
1988 */
1989#define CTIMER_CCR_CAP3I(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CCR_CAP3I_SHIFT)) & CTIMER_CCR_CAP3I_MASK)
1990/*! @} */
1991
1992/*! @name CR - Capture Register . CR is loaded with the value of TC when there is an event on the CAPn. input. */
1993/*! @{ */
1994#define CTIMER_CR_CAP_MASK (0xFFFFFFFFU)
1995#define CTIMER_CR_CAP_SHIFT (0U)
1996/*! CAP - Timer counter capture value.
1997 */
1998#define CTIMER_CR_CAP(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CR_CAP_SHIFT)) & CTIMER_CR_CAP_MASK)
1999/*! @} */
2000
2001/* The count of CTIMER_CR */
2002#define CTIMER_CR_COUNT (4U)
2003
2004/*! @name EMR - External Match Register. The EMR controls the match function and the external match pins. */
2005/*! @{ */
2006#define CTIMER_EMR_EM0_MASK (0x1U)
2007#define CTIMER_EMR_EM0_SHIFT (0U)
2008/*! EM0 - External Match 0. This bit reflects the state of output MAT0, whether or not this output
2009 * is connected to a pin. When a match occurs between the TC and MR0, this bit can either toggle,
2010 * go LOW, go HIGH, or do nothing, as selected by EMR[5:4]. This bit is driven to the MAT pins if
2011 * the match function is selected via IOCON. 0 = LOW. 1 = HIGH.
2012 */
2013#define CTIMER_EMR_EM0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM0_SHIFT)) & CTIMER_EMR_EM0_MASK)
2014#define CTIMER_EMR_EM1_MASK (0x2U)
2015#define CTIMER_EMR_EM1_SHIFT (1U)
2016/*! EM1 - External Match 1. This bit reflects the state of output MAT1, whether or not this output
2017 * is connected to a pin. When a match occurs between the TC and MR1, this bit can either toggle,
2018 * go LOW, go HIGH, or do nothing, as selected by EMR[7:6]. This bit is driven to the MAT pins if
2019 * the match function is selected via IOCON. 0 = LOW. 1 = HIGH.
2020 */
2021#define CTIMER_EMR_EM1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM1_SHIFT)) & CTIMER_EMR_EM1_MASK)
2022#define CTIMER_EMR_EM2_MASK (0x4U)
2023#define CTIMER_EMR_EM2_SHIFT (2U)
2024/*! EM2 - External Match 2. This bit reflects the state of output MAT2, whether or not this output
2025 * is connected to a pin. When a match occurs between the TC and MR2, this bit can either toggle,
2026 * go LOW, go HIGH, or do nothing, as selected by EMR[9:8]. This bit is driven to the MAT pins if
2027 * the match function is selected via IOCON. 0 = LOW. 1 = HIGH.
2028 */
2029#define CTIMER_EMR_EM2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM2_SHIFT)) & CTIMER_EMR_EM2_MASK)
2030#define CTIMER_EMR_EM3_MASK (0x8U)
2031#define CTIMER_EMR_EM3_SHIFT (3U)
2032/*! EM3 - External Match 3. This bit reflects the state of output MAT3, whether or not this output
2033 * is connected to a pin. When a match occurs between the TC and MR3, this bit can either toggle,
2034 * go LOW, go HIGH, or do nothing, as selected by MR[11:10]. This bit is driven to the MAT pins
2035 * if the match function is selected via IOCON. 0 = LOW. 1 = HIGH.
2036 */
2037#define CTIMER_EMR_EM3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EM3_SHIFT)) & CTIMER_EMR_EM3_MASK)
2038#define CTIMER_EMR_EMC0_MASK (0x30U)
2039#define CTIMER_EMR_EMC0_SHIFT (4U)
2040/*! EMC0 - External Match Control 0. Determines the functionality of External Match 0.
2041 * 0b00..Do Nothing.
2042 * 0b01..Clear. Clear the corresponding External Match bit/output to 0 (MAT0 pin is LOW if pinned out).
2043 * 0b10..Set. Set the corresponding External Match bit/output to 1 (MAT0 pin is HIGH if pinned out).
2044 * 0b11..Toggle. Toggle the corresponding External Match bit/output.
2045 */
2046#define CTIMER_EMR_EMC0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC0_SHIFT)) & CTIMER_EMR_EMC0_MASK)
2047#define CTIMER_EMR_EMC1_MASK (0xC0U)
2048#define CTIMER_EMR_EMC1_SHIFT (6U)
2049/*! EMC1 - External Match Control 1. Determines the functionality of External Match 1.
2050 * 0b00..Do Nothing.
2051 * 0b01..Clear. Clear the corresponding External Match bit/output to 0 (MAT1 pin is LOW if pinned out).
2052 * 0b10..Set. Set the corresponding External Match bit/output to 1 (MAT1 pin is HIGH if pinned out).
2053 * 0b11..Toggle. Toggle the corresponding External Match bit/output.
2054 */
2055#define CTIMER_EMR_EMC1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC1_SHIFT)) & CTIMER_EMR_EMC1_MASK)
2056#define CTIMER_EMR_EMC2_MASK (0x300U)
2057#define CTIMER_EMR_EMC2_SHIFT (8U)
2058/*! EMC2 - External Match Control 2. Determines the functionality of External Match 2.
2059 * 0b00..Do Nothing.
2060 * 0b01..Clear. Clear the corresponding External Match bit/output to 0 (MAT2 pin is LOW if pinned out).
2061 * 0b10..Set. Set the corresponding External Match bit/output to 1 (MAT2 pin is HIGH if pinned out).
2062 * 0b11..Toggle. Toggle the corresponding External Match bit/output.
2063 */
2064#define CTIMER_EMR_EMC2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC2_SHIFT)) & CTIMER_EMR_EMC2_MASK)
2065#define CTIMER_EMR_EMC3_MASK (0xC00U)
2066#define CTIMER_EMR_EMC3_SHIFT (10U)
2067/*! EMC3 - External Match Control 3. Determines the functionality of External Match 3.
2068 * 0b00..Do Nothing.
2069 * 0b01..Clear. Clear the corresponding External Match bit/output to 0 (MAT3 pin is LOW if pinned out).
2070 * 0b10..Set. Set the corresponding External Match bit/output to 1 (MAT3 pin is HIGH if pinned out).
2071 * 0b11..Toggle. Toggle the corresponding External Match bit/output.
2072 */
2073#define CTIMER_EMR_EMC3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_EMR_EMC3_SHIFT)) & CTIMER_EMR_EMC3_MASK)
2074/*! @} */
2075
2076/*! @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. */
2077/*! @{ */
2078#define CTIMER_CTCR_CTMODE_MASK (0x3U)
2079#define CTIMER_CTCR_CTMODE_SHIFT (0U)
2080/*! CTMODE - Counter/Timer Mode This field selects which rising APB bus clock edges can increment
2081 * Timer's Prescale Counter (PC), or clear PC and increment Timer Counter (TC). Timer Mode: the TC
2082 * is incremented when the Prescale Counter matches the Prescale Register.
2083 * 0b00..Timer Mode. Incremented every rising APB bus clock edge.
2084 * 0b01..Counter Mode rising edge. TC is incremented on rising edges on the CAP input selected by bits 3:2.
2085 * 0b10..Counter Mode falling edge. TC is incremented on falling edges on the CAP input selected by bits 3:2.
2086 * 0b11..Counter Mode dual edge. TC is incremented on both edges on the CAP input selected by bits 3:2.
2087 */
2088#define CTIMER_CTCR_CTMODE(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CTMODE_SHIFT)) & CTIMER_CTCR_CTMODE_MASK)
2089#define CTIMER_CTCR_CINSEL_MASK (0xCU)
2090#define CTIMER_CTCR_CINSEL_SHIFT (2U)
2091/*! CINSEL - Count Input Select When bits 1:0 in this register are not 00, these bits select which
2092 * CAP pin is sampled for clocking. Note: If Counter mode is selected for a particular CAPn input
2093 * in the CTCR, the 3 bits for that input in the Capture Control Register (CCR) must be
2094 * programmed as 000. However, capture and/or interrupt can be selected for the other 3 CAPn inputs in the
2095 * same timer.
2096 * 0b00..Channel 0. CAPn.0 for CTIMERn
2097 * 0b01..Channel 1. CAPn.1 for CTIMERn
2098 * 0b10..Channel 2. CAPn.2 for CTIMERn
2099 * 0b11..Channel 3. CAPn.3 for CTIMERn
2100 */
2101#define CTIMER_CTCR_CINSEL(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_CINSEL_SHIFT)) & CTIMER_CTCR_CINSEL_MASK)
2102#define CTIMER_CTCR_ENCC_MASK (0x10U)
2103#define CTIMER_CTCR_ENCC_SHIFT (4U)
2104/*! ENCC - Setting this bit to 1 enables clearing of the timer and the prescaler when the
2105 * capture-edge event specified in bits 7:5 occurs.
2106 */
2107#define CTIMER_CTCR_ENCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_ENCC_SHIFT)) & CTIMER_CTCR_ENCC_MASK)
2108#define CTIMER_CTCR_SELCC_MASK (0xE0U)
2109#define CTIMER_CTCR_SELCC_SHIFT (5U)
2110/*! SELCC - Edge select. When bit 4 is 1, these bits select which capture input edge will cause the
2111 * timer and prescaler to be cleared. These bits have no effect when bit 4 is low. Values 0x2 to
2112 * 0x3 and 0x6 to 0x7 are reserved.
2113 * 0b000..Channel 0 Rising Edge. Rising edge of the signal on capture channel 0 clears the timer (if bit 4 is set).
2114 * 0b001..Channel 0 Falling Edge. Falling edge of the signal on capture channel 0 clears the timer (if bit 4 is set).
2115 * 0b010..Channel 1 Rising Edge. Rising edge of the signal on capture channel 1 clears the timer (if bit 4 is set).
2116 * 0b011..Channel 1 Falling Edge. Falling edge of the signal on capture channel 1 clears the timer (if bit 4 is set).
2117 * 0b100..Channel 2 Rising Edge. Rising edge of the signal on capture channel 2 clears the timer (if bit 4 is set).
2118 * 0b101..Channel 2 Falling Edge. Falling edge of the signal on capture channel 2 clears the timer (if bit 4 is set).
2119 */
2120#define CTIMER_CTCR_SELCC(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_CTCR_SELCC_SHIFT)) & CTIMER_CTCR_SELCC_MASK)
2121/*! @} */
2122
2123/*! @name PWMC - PWM Control Register. The PWMCON enables PWM mode for the external match pins. */
2124/*! @{ */
2125#define CTIMER_PWMC_PWMEN0_MASK (0x1U)
2126#define CTIMER_PWMC_PWMEN0_SHIFT (0U)
2127/*! PWMEN0 - PWM mode enable for channel0.
2128 * 0b0..Match. CTIMERn_MAT0 is controlled by EM0.
2129 * 0b1..PWM. PWM mode is enabled for CTIMERn_MAT0.
2130 */
2131#define CTIMER_PWMC_PWMEN0(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN0_SHIFT)) & CTIMER_PWMC_PWMEN0_MASK)
2132#define CTIMER_PWMC_PWMEN1_MASK (0x2U)
2133#define CTIMER_PWMC_PWMEN1_SHIFT (1U)
2134/*! PWMEN1 - PWM mode enable for channel1.
2135 * 0b0..Match. CTIMERn_MAT01 is controlled by EM1.
2136 * 0b1..PWM. PWM mode is enabled for CTIMERn_MAT1.
2137 */
2138#define CTIMER_PWMC_PWMEN1(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN1_SHIFT)) & CTIMER_PWMC_PWMEN1_MASK)
2139#define CTIMER_PWMC_PWMEN2_MASK (0x4U)
2140#define CTIMER_PWMC_PWMEN2_SHIFT (2U)
2141/*! PWMEN2 - PWM mode enable for channel2.
2142 * 0b0..Match. CTIMERn_MAT2 is controlled by EM2.
2143 * 0b1..PWM. PWM mode is enabled for CTIMERn_MAT2.
2144 */
2145#define CTIMER_PWMC_PWMEN2(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN2_SHIFT)) & CTIMER_PWMC_PWMEN2_MASK)
2146#define CTIMER_PWMC_PWMEN3_MASK (0x8U)
2147#define CTIMER_PWMC_PWMEN3_SHIFT (3U)
2148/*! PWMEN3 - PWM mode enable for channel3. Note: It is recommended to use match channel 3 to set the PWM cycle.
2149 * 0b0..Match. CTIMERn_MAT3 is controlled by EM3.
2150 * 0b1..PWM. PWM mode is enabled for CT132Bn_MAT3.
2151 */
2152#define CTIMER_PWMC_PWMEN3(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_PWMC_PWMEN3_SHIFT)) & CTIMER_PWMC_PWMEN3_MASK)
2153/*! @} */
2154
2155/*! @name MSR - Match Shadow Register */
2156/*! @{ */
2157#define CTIMER_MSR_SHADOWW_MASK (0xFFFFFFFFU)
2158#define CTIMER_MSR_SHADOWW_SHIFT (0U)
2159/*! SHADOWW - Timer counter match shadow value.
2160 */
2161#define CTIMER_MSR_SHADOWW(x) (((uint32_t)(((uint32_t)(x)) << CTIMER_MSR_SHADOWW_SHIFT)) & CTIMER_MSR_SHADOWW_MASK)
2162/*! @} */
2163
2164/* The count of CTIMER_MSR */
2165#define CTIMER_MSR_COUNT (4U)
2166
2167
2168/*!
2169 * @}
2170 */ /* end of group CTIMER_Register_Masks */
2171
2172
2173/* CTIMER - Peripheral instance base addresses */
2174/** Peripheral CTIMER0 base address */
2175#define CTIMER0_BASE (0x40008000u)
2176/** Peripheral CTIMER0 base pointer */
2177#define CTIMER0 ((CTIMER_Type *)CTIMER0_BASE)
2178/** Peripheral CTIMER1 base address */
2179#define CTIMER1_BASE (0x40009000u)
2180/** Peripheral CTIMER1 base pointer */
2181#define CTIMER1 ((CTIMER_Type *)CTIMER1_BASE)
2182/** Peripheral CTIMER2 base address */
2183#define CTIMER2_BASE (0x40028000u)
2184/** Peripheral CTIMER2 base pointer */
2185#define CTIMER2 ((CTIMER_Type *)CTIMER2_BASE)
2186/** Peripheral CTIMER3 base address */
2187#define CTIMER3_BASE (0x40048000u)
2188/** Peripheral CTIMER3 base pointer */
2189#define CTIMER3 ((CTIMER_Type *)CTIMER3_BASE)
2190/** Peripheral CTIMER4 base address */
2191#define CTIMER4_BASE (0x40049000u)
2192/** Peripheral CTIMER4 base pointer */
2193#define CTIMER4 ((CTIMER_Type *)CTIMER4_BASE)
2194/** Array initializer of CTIMER peripheral base addresses */
2195#define CTIMER_BASE_ADDRS { CTIMER0_BASE, CTIMER1_BASE, CTIMER2_BASE, CTIMER3_BASE, CTIMER4_BASE }
2196/** Array initializer of CTIMER peripheral base pointers */
2197#define CTIMER_BASE_PTRS { CTIMER0, CTIMER1, CTIMER2, CTIMER3, CTIMER4 }
2198/** Interrupt vectors for the CTIMER peripheral type */
2199#define CTIMER_IRQS { CTIMER0_IRQn, CTIMER1_IRQn, CTIMER2_IRQn, CTIMER3_IRQn, CTIMER4_IRQn }
2200
2201/*!
2202 * @}
2203 */ /* end of group CTIMER_Peripheral_Access_Layer */
2204
2205
2206/* ----------------------------------------------------------------------------
2207 -- DMA Peripheral Access Layer
2208 ---------------------------------------------------------------------------- */
2209
2210/*!
2211 * @addtogroup DMA_Peripheral_Access_Layer DMA Peripheral Access Layer
2212 * @{
2213 */
2214
2215/** DMA - Register Layout Typedef */
2216typedef struct {
2217 __IO uint32_t CTRL; /**< DMA control., offset: 0x0 */
2218 __I uint32_t INTSTAT; /**< Interrupt status., offset: 0x4 */
2219 __IO uint32_t SRAMBASE; /**< SRAM address of the channel configuration table., offset: 0x8 */
2220 uint8_t RESERVED_0[20];
2221 struct { /* offset: 0x20, array step: 0x5C */
2222 __IO uint32_t ENABLESET; /**< Channel Enable read and Set for all DMA channels., array offset: 0x20, array step: 0x5C */
2223 uint8_t RESERVED_0[4];
2224 __O uint32_t ENABLECLR; /**< Channel Enable Clear for all DMA channels., array offset: 0x28, array step: 0x5C */
2225 uint8_t RESERVED_1[4];
2226 __I uint32_t ACTIVE; /**< Channel Active status for all DMA channels., array offset: 0x30, array step: 0x5C */
2227 uint8_t RESERVED_2[4];
2228 __I uint32_t BUSY; /**< Channel Busy status for all DMA channels., array offset: 0x38, array step: 0x5C */
2229 uint8_t RESERVED_3[4];
2230 __IO uint32_t ERRINT; /**< Error Interrupt status for all DMA channels., array offset: 0x40, array step: 0x5C */
2231 uint8_t RESERVED_4[4];
2232 __IO uint32_t INTENSET; /**< Interrupt Enable read and Set for all DMA channels., array offset: 0x48, array step: 0x5C */
2233 uint8_t RESERVED_5[4];
2234 __O uint32_t INTENCLR; /**< Interrupt Enable Clear for all DMA channels., array offset: 0x50, array step: 0x5C */
2235 uint8_t RESERVED_6[4];
2236 __IO uint32_t INTA; /**< Interrupt A status for all DMA channels., array offset: 0x58, array step: 0x5C */
2237 uint8_t RESERVED_7[4];
2238 __IO uint32_t INTB; /**< Interrupt B status for all DMA channels., array offset: 0x60, array step: 0x5C */
2239 uint8_t RESERVED_8[4];
2240 __O uint32_t SETVALID; /**< Set ValidPending control bits for all DMA channels., array offset: 0x68, array step: 0x5C */
2241 uint8_t RESERVED_9[4];
2242 __O uint32_t SETTRIG; /**< Set Trigger control bits for all DMA channels., array offset: 0x70, array step: 0x5C */
2243 uint8_t RESERVED_10[4];
2244 __O uint32_t ABORT; /**< Channel Abort control for all DMA channels., array offset: 0x78, array step: 0x5C */
2245 } COMMON[1];
2246 uint8_t RESERVED_1[900];
2247 struct { /* offset: 0x400, array step: 0x10 */
2248 __IO uint32_t CFG; /**< Configuration register for DMA channel ., array offset: 0x400, array step: 0x10 */
2249 __I uint32_t CTLSTAT; /**< Control and status register for DMA channel ., array offset: 0x404, array step: 0x10 */
2250 __IO uint32_t XFERCFG; /**< Transfer configuration register for DMA channel ., array offset: 0x408, array step: 0x10 */
2251 uint8_t RESERVED_0[4];
2252 } CHANNEL[32];
2253} DMA_Type;
2254
2255/* ----------------------------------------------------------------------------
2256 -- DMA Register Masks
2257 ---------------------------------------------------------------------------- */
2258
2259/*!
2260 * @addtogroup DMA_Register_Masks DMA Register Masks
2261 * @{
2262 */
2263
2264/*! @name CTRL - DMA control. */
2265/*! @{ */
2266#define DMA_CTRL_ENABLE_MASK (0x1U)
2267#define DMA_CTRL_ENABLE_SHIFT (0U)
2268/*! ENABLE - DMA controller master enable.
2269 * 0b0..Disabled. The DMA controller is disabled. This clears any triggers that were asserted at the point when
2270 * disabled, but does not prevent re-triggering when the DMA controller is re-enabled.
2271 * 0b1..Enabled. The DMA controller is enabled.
2272 */
2273#define DMA_CTRL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CTRL_ENABLE_SHIFT)) & DMA_CTRL_ENABLE_MASK)
2274/*! @} */
2275
2276/*! @name INTSTAT - Interrupt status. */
2277/*! @{ */
2278#define DMA_INTSTAT_ACTIVEINT_MASK (0x2U)
2279#define DMA_INTSTAT_ACTIVEINT_SHIFT (1U)
2280/*! ACTIVEINT - Summarizes whether any enabled interrupts (other than error interrupts) are pending.
2281 * 0b0..Not pending. No enabled interrupts are pending.
2282 * 0b1..Pending. At least one enabled interrupt is pending.
2283 */
2284#define DMA_INTSTAT_ACTIVEINT(x) (((uint32_t)(((uint32_t)(x)) << DMA_INTSTAT_ACTIVEINT_SHIFT)) & DMA_INTSTAT_ACTIVEINT_MASK)
2285#define DMA_INTSTAT_ACTIVEERRINT_MASK (0x4U)
2286#define DMA_INTSTAT_ACTIVEERRINT_SHIFT (2U)
2287/*! ACTIVEERRINT - Summarizes whether any error interrupts are pending.
2288 * 0b0..Not pending. No error interrupts are pending.
2289 * 0b1..Pending. At least one error interrupt is pending.
2290 */
2291#define DMA_INTSTAT_ACTIVEERRINT(x) (((uint32_t)(((uint32_t)(x)) << DMA_INTSTAT_ACTIVEERRINT_SHIFT)) & DMA_INTSTAT_ACTIVEERRINT_MASK)
2292/*! @} */
2293
2294/*! @name SRAMBASE - SRAM address of the channel configuration table. */
2295/*! @{ */
2296#define DMA_SRAMBASE_OFFSET_MASK (0xFFFFFE00U)
2297#define DMA_SRAMBASE_OFFSET_SHIFT (9U)
2298/*! OFFSET - Address bits 31:9 of the beginning of the DMA descriptor table. For 18 channels, the
2299 * table must begin on a 512 byte boundary.
2300 */
2301#define DMA_SRAMBASE_OFFSET(x) (((uint32_t)(((uint32_t)(x)) << DMA_SRAMBASE_OFFSET_SHIFT)) & DMA_SRAMBASE_OFFSET_MASK)
2302/*! @} */
2303
2304/*! @name COMMON_ENABLESET - Channel Enable read and Set for all DMA channels. */
2305/*! @{ */
2306#define DMA_COMMON_ENABLESET_ENA_MASK (0xFFFFFFFFU)
2307#define DMA_COMMON_ENABLESET_ENA_SHIFT (0U)
2308/*! ENA - Enable for DMA channels. Bit n enables or disables DMA channel n. The number of bits =
2309 * number of DMA channels in this device. Other bits are reserved. 0 = disabled. 1 = enabled.
2310 */
2311#define DMA_COMMON_ENABLESET_ENA(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_ENABLESET_ENA_SHIFT)) & DMA_COMMON_ENABLESET_ENA_MASK)
2312/*! @} */
2313
2314/* The count of DMA_COMMON_ENABLESET */
2315#define DMA_COMMON_ENABLESET_COUNT (1U)
2316
2317/*! @name COMMON_ENABLECLR - Channel Enable Clear for all DMA channels. */
2318/*! @{ */
2319#define DMA_COMMON_ENABLECLR_CLR_MASK (0xFFFFFFFFU)
2320#define DMA_COMMON_ENABLECLR_CLR_SHIFT (0U)
2321/*! CLR - Writing ones to this register clears the corresponding bits in ENABLESET0. Bit n clears
2322 * the channel enable bit n. The number of bits = number of DMA channels in this device. Other bits
2323 * are reserved.
2324 */
2325#define DMA_COMMON_ENABLECLR_CLR(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_ENABLECLR_CLR_SHIFT)) & DMA_COMMON_ENABLECLR_CLR_MASK)
2326/*! @} */
2327
2328/* The count of DMA_COMMON_ENABLECLR */
2329#define DMA_COMMON_ENABLECLR_COUNT (1U)
2330
2331/*! @name COMMON_ACTIVE - Channel Active status for all DMA channels. */
2332/*! @{ */
2333#define DMA_COMMON_ACTIVE_ACT_MASK (0xFFFFFFFFU)
2334#define DMA_COMMON_ACTIVE_ACT_SHIFT (0U)
2335/*! ACT - Active flag for DMA channel n. Bit n corresponds to DMA channel n. The number of bits =
2336 * number of DMA channels in this device. Other bits are reserved. 0 = not active. 1 = active.
2337 */
2338#define DMA_COMMON_ACTIVE_ACT(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_ACTIVE_ACT_SHIFT)) & DMA_COMMON_ACTIVE_ACT_MASK)
2339/*! @} */
2340
2341/* The count of DMA_COMMON_ACTIVE */
2342#define DMA_COMMON_ACTIVE_COUNT (1U)
2343
2344/*! @name COMMON_BUSY - Channel Busy status for all DMA channels. */
2345/*! @{ */
2346#define DMA_COMMON_BUSY_BSY_MASK (0xFFFFFFFFU)
2347#define DMA_COMMON_BUSY_BSY_SHIFT (0U)
2348/*! BSY - Busy flag for DMA channel n. Bit n corresponds to DMA channel n. The number of bits =
2349 * number of DMA channels in this device. Other bits are reserved. 0 = not busy. 1 = busy.
2350 */
2351#define DMA_COMMON_BUSY_BSY(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_BUSY_BSY_SHIFT)) & DMA_COMMON_BUSY_BSY_MASK)
2352/*! @} */
2353
2354/* The count of DMA_COMMON_BUSY */
2355#define DMA_COMMON_BUSY_COUNT (1U)
2356
2357/*! @name COMMON_ERRINT - Error Interrupt status for all DMA channels. */
2358/*! @{ */
2359#define DMA_COMMON_ERRINT_ERR_MASK (0xFFFFFFFFU)
2360#define DMA_COMMON_ERRINT_ERR_SHIFT (0U)
2361/*! ERR - Error Interrupt flag for DMA channel n. Bit n corresponds to DMA channel n. The number of
2362 * bits = number of DMA channels in this device. Other bits are reserved. 0 = error interrupt is
2363 * not active. 1 = error interrupt is active.
2364 */
2365#define DMA_COMMON_ERRINT_ERR(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_ERRINT_ERR_SHIFT)) & DMA_COMMON_ERRINT_ERR_MASK)
2366/*! @} */
2367
2368/* The count of DMA_COMMON_ERRINT */
2369#define DMA_COMMON_ERRINT_COUNT (1U)
2370
2371/*! @name COMMON_INTENSET - Interrupt Enable read and Set for all DMA channels. */
2372/*! @{ */
2373#define DMA_COMMON_INTENSET_INTEN_MASK (0xFFFFFFFFU)
2374#define DMA_COMMON_INTENSET_INTEN_SHIFT (0U)
2375/*! INTEN - Interrupt Enable read and set for DMA channel n. Bit n corresponds to DMA channel n. The
2376 * number of bits = number of DMA channels in this device. Other bits are reserved. 0 =
2377 * interrupt for DMA channel is disabled. 1 = interrupt for DMA channel is enabled.
2378 */
2379#define DMA_COMMON_INTENSET_INTEN(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_INTENSET_INTEN_SHIFT)) & DMA_COMMON_INTENSET_INTEN_MASK)
2380/*! @} */
2381
2382/* The count of DMA_COMMON_INTENSET */
2383#define DMA_COMMON_INTENSET_COUNT (1U)
2384
2385/*! @name COMMON_INTENCLR - Interrupt Enable Clear for all DMA channels. */
2386/*! @{ */
2387#define DMA_COMMON_INTENCLR_CLR_MASK (0xFFFFFFFFU)
2388#define DMA_COMMON_INTENCLR_CLR_SHIFT (0U)
2389/*! CLR - Writing ones to this register clears corresponding bits in the INTENSET0. Bit n
2390 * corresponds to DMA channel n. The number of bits = number of DMA channels in this device. Other bits are
2391 * reserved.
2392 */
2393#define DMA_COMMON_INTENCLR_CLR(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_INTENCLR_CLR_SHIFT)) & DMA_COMMON_INTENCLR_CLR_MASK)
2394/*! @} */
2395
2396/* The count of DMA_COMMON_INTENCLR */
2397#define DMA_COMMON_INTENCLR_COUNT (1U)
2398
2399/*! @name COMMON_INTA - Interrupt A status for all DMA channels. */
2400/*! @{ */
2401#define DMA_COMMON_INTA_IA_MASK (0xFFFFFFFFU)
2402#define DMA_COMMON_INTA_IA_SHIFT (0U)
2403/*! IA - Interrupt A status for DMA channel n. Bit n corresponds to DMA channel n. The number of
2404 * bits = number of DMA channels in this device. Other bits are reserved. 0 = the DMA channel
2405 * interrupt A is not active. 1 = the DMA channel interrupt A is active.
2406 */
2407#define DMA_COMMON_INTA_IA(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_INTA_IA_SHIFT)) & DMA_COMMON_INTA_IA_MASK)
2408/*! @} */
2409
2410/* The count of DMA_COMMON_INTA */
2411#define DMA_COMMON_INTA_COUNT (1U)
2412
2413/*! @name COMMON_INTB - Interrupt B status for all DMA channels. */
2414/*! @{ */
2415#define DMA_COMMON_INTB_IB_MASK (0xFFFFFFFFU)
2416#define DMA_COMMON_INTB_IB_SHIFT (0U)
2417/*! IB - Interrupt B status for DMA channel n. Bit n corresponds to DMA channel n. The number of
2418 * bits = number of DMA channels in this device. Other bits are reserved. 0 = the DMA channel
2419 * interrupt B is not active. 1 = the DMA channel interrupt B is active.
2420 */
2421#define DMA_COMMON_INTB_IB(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_INTB_IB_SHIFT)) & DMA_COMMON_INTB_IB_MASK)
2422/*! @} */
2423
2424/* The count of DMA_COMMON_INTB */
2425#define DMA_COMMON_INTB_COUNT (1U)
2426
2427/*! @name COMMON_SETVALID - Set ValidPending control bits for all DMA channels. */
2428/*! @{ */
2429#define DMA_COMMON_SETVALID_SV_MASK (0xFFFFFFFFU)
2430#define DMA_COMMON_SETVALID_SV_SHIFT (0U)
2431/*! SV - SETVALID control for DMA channel n. Bit n corresponds to DMA channel n. The number of bits
2432 * = number of DMA channels in this device. Other bits are reserved. 0 = no effect. 1 = sets the
2433 * VALIDPENDING control bit for DMA channel n
2434 */
2435#define DMA_COMMON_SETVALID_SV(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_SETVALID_SV_SHIFT)) & DMA_COMMON_SETVALID_SV_MASK)
2436/*! @} */
2437
2438/* The count of DMA_COMMON_SETVALID */
2439#define DMA_COMMON_SETVALID_COUNT (1U)
2440
2441/*! @name COMMON_SETTRIG - Set Trigger control bits for all DMA channels. */
2442/*! @{ */
2443#define DMA_COMMON_SETTRIG_TRIG_MASK (0xFFFFFFFFU)
2444#define DMA_COMMON_SETTRIG_TRIG_SHIFT (0U)
2445/*! TRIG - Set Trigger control bit for DMA channel 0. Bit n corresponds to DMA channel n. The number
2446 * of bits = number of DMA channels in this device. Other bits are reserved. 0 = no effect. 1 =
2447 * sets the TRIG bit for DMA channel n.
2448 */
2449#define DMA_COMMON_SETTRIG_TRIG(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_SETTRIG_TRIG_SHIFT)) & DMA_COMMON_SETTRIG_TRIG_MASK)
2450/*! @} */
2451
2452/* The count of DMA_COMMON_SETTRIG */
2453#define DMA_COMMON_SETTRIG_COUNT (1U)
2454
2455/*! @name COMMON_ABORT - Channel Abort control for all DMA channels. */
2456/*! @{ */
2457#define DMA_COMMON_ABORT_ABORTCTRL_MASK (0xFFFFFFFFU)
2458#define DMA_COMMON_ABORT_ABORTCTRL_SHIFT (0U)
2459/*! ABORTCTRL - Abort control for DMA channel 0. Bit n corresponds to DMA channel n. 0 = no effect.
2460 * 1 = aborts DMA operations on channel n.
2461 */
2462#define DMA_COMMON_ABORT_ABORTCTRL(x) (((uint32_t)(((uint32_t)(x)) << DMA_COMMON_ABORT_ABORTCTRL_SHIFT)) & DMA_COMMON_ABORT_ABORTCTRL_MASK)
2463/*! @} */
2464
2465/* The count of DMA_COMMON_ABORT */
2466#define DMA_COMMON_ABORT_COUNT (1U)
2467
2468/*! @name CHANNEL_CFG - Configuration register for DMA channel . */
2469/*! @{ */
2470#define DMA_CHANNEL_CFG_PERIPHREQEN_MASK (0x1U)
2471#define DMA_CHANNEL_CFG_PERIPHREQEN_SHIFT (0U)
2472/*! PERIPHREQEN - Peripheral request Enable. If a DMA channel is used to perform a memory-to-memory
2473 * move, any peripheral DMA request associated with that channel can be disabled to prevent any
2474 * interaction between the peripheral and the DMA controller.
2475 * 0b0..Disabled. Peripheral DMA requests are disabled.
2476 * 0b1..Enabled. Peripheral DMA requests are enabled.
2477 */
2478#define DMA_CHANNEL_CFG_PERIPHREQEN(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_PERIPHREQEN_SHIFT)) & DMA_CHANNEL_CFG_PERIPHREQEN_MASK)
2479#define DMA_CHANNEL_CFG_HWTRIGEN_MASK (0x2U)
2480#define DMA_CHANNEL_CFG_HWTRIGEN_SHIFT (1U)
2481/*! HWTRIGEN - Hardware Triggering Enable for this channel.
2482 * 0b0..Disabled. Hardware triggering is not used.
2483 * 0b1..Enabled. Use hardware triggering.
2484 */
2485#define DMA_CHANNEL_CFG_HWTRIGEN(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_HWTRIGEN_SHIFT)) & DMA_CHANNEL_CFG_HWTRIGEN_MASK)
2486#define DMA_CHANNEL_CFG_TRIGPOL_MASK (0x10U)
2487#define DMA_CHANNEL_CFG_TRIGPOL_SHIFT (4U)
2488/*! TRIGPOL - Trigger Polarity. Selects the polarity of a hardware trigger for this channel.
2489 * 0b0..Active low - falling edge. Hardware trigger is active low or falling edge triggered, based on TRIGTYPE.
2490 * 0b1..Active high - rising edge. Hardware trigger is active high or rising edge triggered, based on TRIGTYPE.
2491 */
2492#define DMA_CHANNEL_CFG_TRIGPOL(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_TRIGPOL_SHIFT)) & DMA_CHANNEL_CFG_TRIGPOL_MASK)
2493#define DMA_CHANNEL_CFG_TRIGTYPE_MASK (0x20U)
2494#define DMA_CHANNEL_CFG_TRIGTYPE_SHIFT (5U)
2495/*! TRIGTYPE - Trigger Type. Selects hardware trigger as edge triggered or level triggered.
2496 * 0b0..Edge. Hardware trigger is edge triggered. Transfers will be initiated and completed, as specified for a single trigger.
2497 * 0b1..Level. Hardware trigger is level triggered. Note that when level triggering without burst (BURSTPOWER =
2498 * 0) is selected, only hardware triggers should be used on that channel. Transfers continue as long as the
2499 * trigger level is asserted. Once the trigger is de-asserted, the transfer will be paused until the trigger
2500 * is, again, asserted. However, the transfer will not be paused until any remaining transfers within the
2501 * current BURSTPOWER length are completed.
2502 */
2503#define DMA_CHANNEL_CFG_TRIGTYPE(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_TRIGTYPE_SHIFT)) & DMA_CHANNEL_CFG_TRIGTYPE_MASK)
2504#define DMA_CHANNEL_CFG_TRIGBURST_MASK (0x40U)
2505#define DMA_CHANNEL_CFG_TRIGBURST_SHIFT (6U)
2506/*! TRIGBURST - Trigger Burst. Selects whether hardware triggers cause a single or burst transfer.
2507 * 0b0..Single transfer. Hardware trigger causes a single transfer.
2508 * 0b1..Burst transfer. When the trigger for this channel is set to edge triggered, a hardware trigger causes a
2509 * burst transfer, as defined by BURSTPOWER. When the trigger for this channel is set to level triggered, a
2510 * hardware trigger causes transfers to continue as long as the trigger is asserted, unless the transfer is
2511 * complete.
2512 */
2513#define DMA_CHANNEL_CFG_TRIGBURST(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_TRIGBURST_SHIFT)) & DMA_CHANNEL_CFG_TRIGBURST_MASK)
2514#define DMA_CHANNEL_CFG_BURSTPOWER_MASK (0xF00U)
2515#define DMA_CHANNEL_CFG_BURSTPOWER_SHIFT (8U)
2516/*! BURSTPOWER - Burst Power is used in two ways. It always selects the address wrap size when
2517 * SRCBURSTWRAP and/or DSTBURSTWRAP modes are selected (see descriptions elsewhere in this register).
2518 * When the TRIGBURST field elsewhere in this register = 1, Burst Power selects how many
2519 * transfers are performed for each DMA trigger. This can be used, for example, with peripherals that
2520 * contain a FIFO that can initiate a DMA operation when the FIFO reaches a certain level. 0000:
2521 * Burst size = 1 (20). 0001: Burst size = 2 (21). 0010: Burst size = 4 (22). 1010: Burst size =
2522 * 1024 (210). This corresponds to the maximum supported transfer count. others: not supported. The
2523 * total transfer length as defined in the XFERCOUNT bits in the XFERCFG register must be an even
2524 * multiple of the burst size.
2525 */
2526#define DMA_CHANNEL_CFG_BURSTPOWER(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_BURSTPOWER_SHIFT)) & DMA_CHANNEL_CFG_BURSTPOWER_MASK)
2527#define DMA_CHANNEL_CFG_SRCBURSTWRAP_MASK (0x4000U)
2528#define DMA_CHANNEL_CFG_SRCBURSTWRAP_SHIFT (14U)
2529/*! SRCBURSTWRAP - Source Burst Wrap. When enabled, the source data address for the DMA is
2530 * 'wrapped', meaning that the source address range for each burst will be the same. As an example, this
2531 * could be used to read several sequential registers from a peripheral for each DMA burst,
2532 * reading the same registers again for each burst.
2533 * 0b0..Disabled. Source burst wrapping is not enabled for this DMA channel.
2534 * 0b1..Enabled. Source burst wrapping is enabled for this DMA channel.
2535 */
2536#define DMA_CHANNEL_CFG_SRCBURSTWRAP(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_SRCBURSTWRAP_SHIFT)) & DMA_CHANNEL_CFG_SRCBURSTWRAP_MASK)
2537#define DMA_CHANNEL_CFG_DSTBURSTWRAP_MASK (0x8000U)
2538#define DMA_CHANNEL_CFG_DSTBURSTWRAP_SHIFT (15U)
2539/*! DSTBURSTWRAP - Destination Burst Wrap. When enabled, the destination data address for the DMA is
2540 * 'wrapped', meaning that the destination address range for each burst will be the same. As an
2541 * example, this could be used to write several sequential registers to a peripheral for each DMA
2542 * burst, writing the same registers again for each burst.
2543 * 0b0..Disabled. Destination burst wrapping is not enabled for this DMA channel.
2544 * 0b1..Enabled. Destination burst wrapping is enabled for this DMA channel.
2545 */
2546#define DMA_CHANNEL_CFG_DSTBURSTWRAP(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_DSTBURSTWRAP_SHIFT)) & DMA_CHANNEL_CFG_DSTBURSTWRAP_MASK)
2547#define DMA_CHANNEL_CFG_CHPRIORITY_MASK (0x70000U)
2548#define DMA_CHANNEL_CFG_CHPRIORITY_SHIFT (16U)
2549/*! CHPRIORITY - Priority of this channel when multiple DMA requests are pending. Eight priority
2550 * levels are supported: 0x0 = highest priority. 0x7 = lowest priority.
2551 */
2552#define DMA_CHANNEL_CFG_CHPRIORITY(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CFG_CHPRIORITY_SHIFT)) & DMA_CHANNEL_CFG_CHPRIORITY_MASK)
2553/*! @} */
2554
2555/* The count of DMA_CHANNEL_CFG */
2556#define DMA_CHANNEL_CFG_COUNT (32U)
2557
2558/*! @name CHANNEL_CTLSTAT - Control and status register for DMA channel . */
2559/*! @{ */
2560#define DMA_CHANNEL_CTLSTAT_VALIDPENDING_MASK (0x1U)
2561#define DMA_CHANNEL_CTLSTAT_VALIDPENDING_SHIFT (0U)
2562/*! VALIDPENDING - Valid pending flag for this channel. This bit is set when a 1 is written to the
2563 * corresponding bit in the related SETVALID register when CFGVALID = 1 for the same channel.
2564 * 0b0..No effect. No effect on DMA operation.
2565 * 0b1..Valid pending.
2566 */
2567#define DMA_CHANNEL_CTLSTAT_VALIDPENDING(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CTLSTAT_VALIDPENDING_SHIFT)) & DMA_CHANNEL_CTLSTAT_VALIDPENDING_MASK)
2568#define DMA_CHANNEL_CTLSTAT_TRIG_MASK (0x4U)
2569#define DMA_CHANNEL_CTLSTAT_TRIG_SHIFT (2U)
2570/*! TRIG - Trigger flag. Indicates that the trigger for this channel is currently set. This bit is
2571 * cleared at the end of an entire transfer or upon reload when CLRTRIG = 1.
2572 * 0b0..Not triggered. The trigger for this DMA channel is not set. DMA operations will not be carried out.
2573 * 0b1..Triggered. The trigger for this DMA channel is set. DMA operations will be carried out.
2574 */
2575#define DMA_CHANNEL_CTLSTAT_TRIG(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_CTLSTAT_TRIG_SHIFT)) & DMA_CHANNEL_CTLSTAT_TRIG_MASK)
2576/*! @} */
2577
2578/* The count of DMA_CHANNEL_CTLSTAT */
2579#define DMA_CHANNEL_CTLSTAT_COUNT (32U)
2580
2581/*! @name CHANNEL_XFERCFG - Transfer configuration register for DMA channel . */
2582/*! @{ */
2583#define DMA_CHANNEL_XFERCFG_CFGVALID_MASK (0x1U)
2584#define DMA_CHANNEL_XFERCFG_CFGVALID_SHIFT (0U)
2585/*! CFGVALID - Configuration Valid flag. This bit indicates whether the current channel descriptor
2586 * is valid and can potentially be acted upon, if all other activation criteria are fulfilled.
2587 * 0b0..Not valid. The channel descriptor is not considered valid until validated by an associated SETVALID0 setting.
2588 * 0b1..Valid. The current channel descriptor is considered valid.
2589 */
2590#define DMA_CHANNEL_XFERCFG_CFGVALID(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_CFGVALID_SHIFT)) & DMA_CHANNEL_XFERCFG_CFGVALID_MASK)
2591#define DMA_CHANNEL_XFERCFG_RELOAD_MASK (0x2U)
2592#define DMA_CHANNEL_XFERCFG_RELOAD_SHIFT (1U)
2593/*! RELOAD - Indicates whether the channel's control structure will be reloaded when the current
2594 * descriptor is exhausted. Reloading allows ping-pong and linked transfers.
2595 * 0b0..Disabled. Do not reload the channels' control structure when the current descriptor is exhausted.
2596 * 0b1..Enabled. Reload the channels' control structure when the current descriptor is exhausted.
2597 */
2598#define DMA_CHANNEL_XFERCFG_RELOAD(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_RELOAD_SHIFT)) & DMA_CHANNEL_XFERCFG_RELOAD_MASK)
2599#define DMA_CHANNEL_XFERCFG_SWTRIG_MASK (0x4U)
2600#define DMA_CHANNEL_XFERCFG_SWTRIG_SHIFT (2U)
2601/*! SWTRIG - Software Trigger.
2602 * 0b0..Not set. When written by software, the trigger for this channel is not set. A new trigger, as defined by
2603 * the HWTRIGEN, TRIGPOL, and TRIGTYPE will be needed to start the channel.
2604 * 0b1..Set. When written by software, the trigger for this channel is set immediately. This feature should not
2605 * be used with level triggering when TRIGBURST = 0.
2606 */
2607#define DMA_CHANNEL_XFERCFG_SWTRIG(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_SWTRIG_SHIFT)) & DMA_CHANNEL_XFERCFG_SWTRIG_MASK)
2608#define DMA_CHANNEL_XFERCFG_CLRTRIG_MASK (0x8U)
2609#define DMA_CHANNEL_XFERCFG_CLRTRIG_SHIFT (3U)
2610/*! CLRTRIG - Clear Trigger.
2611 * 0b0..Not cleared. The trigger is not cleared when this descriptor is exhausted. If there is a reload, the next descriptor will be started.
2612 * 0b1..Cleared. The trigger is cleared when this descriptor is exhausted
2613 */
2614#define DMA_CHANNEL_XFERCFG_CLRTRIG(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_CLRTRIG_SHIFT)) & DMA_CHANNEL_XFERCFG_CLRTRIG_MASK)
2615#define DMA_CHANNEL_XFERCFG_SETINTA_MASK (0x10U)
2616#define DMA_CHANNEL_XFERCFG_SETINTA_SHIFT (4U)
2617/*! SETINTA - Set Interrupt flag A for this channel. There is no hardware distinction between
2618 * interrupt A and B. They can be used by software to assist with more complex descriptor usage. By
2619 * convention, interrupt A may be used when only one interrupt flag is needed.
2620 * 0b0..No effect.
2621 * 0b1..Set. The INTA flag for this channel will be set when the current descriptor is exhausted.
2622 */
2623#define DMA_CHANNEL_XFERCFG_SETINTA(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_SETINTA_SHIFT)) & DMA_CHANNEL_XFERCFG_SETINTA_MASK)
2624#define DMA_CHANNEL_XFERCFG_SETINTB_MASK (0x20U)
2625#define DMA_CHANNEL_XFERCFG_SETINTB_SHIFT (5U)
2626/*! SETINTB - Set Interrupt flag B for this channel. There is no hardware distinction between
2627 * interrupt A and B. They can be used by software to assist with more complex descriptor usage. By
2628 * convention, interrupt A may be used when only one interrupt flag is needed.
2629 * 0b0..No effect.
2630 * 0b1..Set. The INTB flag for this channel will be set when the current descriptor is exhausted.
2631 */
2632#define DMA_CHANNEL_XFERCFG_SETINTB(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_SETINTB_SHIFT)) & DMA_CHANNEL_XFERCFG_SETINTB_MASK)
2633#define DMA_CHANNEL_XFERCFG_WIDTH_MASK (0x300U)
2634#define DMA_CHANNEL_XFERCFG_WIDTH_SHIFT (8U)
2635/*! WIDTH - Transfer width used for this DMA channel.
2636 * 0b00..8-bit. 8-bit transfers are performed (8-bit source reads and destination writes).
2637 * 0b01..16-bit. 6-bit transfers are performed (16-bit source reads and destination writes).
2638 * 0b10..32-bit. 32-bit transfers are performed (32-bit source reads and destination writes).
2639 * 0b11..Reserved. Reserved setting, do not use.
2640 */
2641#define DMA_CHANNEL_XFERCFG_WIDTH(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_WIDTH_SHIFT)) & DMA_CHANNEL_XFERCFG_WIDTH_MASK)
2642#define DMA_CHANNEL_XFERCFG_SRCINC_MASK (0x3000U)
2643#define DMA_CHANNEL_XFERCFG_SRCINC_SHIFT (12U)
2644/*! SRCINC - Determines whether the source address is incremented for each DMA transfer.
2645 * 0b00..No increment. The source address is not incremented for each transfer. This is the usual case when the source is a peripheral device.
2646 * 0b01..1 x width. The source address is incremented by the amount specified by Width for each transfer. This is
2647 * the usual case when the source is memory.
2648 * 0b10..2 x width. The source address is incremented by 2 times the amount specified by Width for each transfer.
2649 * 0b11..4 x width. The source address is incremented by 4 times the amount specified by Width for each transfer.
2650 */
2651#define DMA_CHANNEL_XFERCFG_SRCINC(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_SRCINC_SHIFT)) & DMA_CHANNEL_XFERCFG_SRCINC_MASK)
2652#define DMA_CHANNEL_XFERCFG_DSTINC_MASK (0xC000U)
2653#define DMA_CHANNEL_XFERCFG_DSTINC_SHIFT (14U)
2654/*! DSTINC - Determines whether the destination address is incremented for each DMA transfer.
2655 * 0b00..No increment. The destination address is not incremented for each transfer. This is the usual case when
2656 * the destination is a peripheral device.
2657 * 0b01..1 x width. The destination address is incremented by the amount specified by Width for each transfer.
2658 * This is the usual case when the destination is memory.
2659 * 0b10..2 x width. The destination address is incremented by 2 times the amount specified by Width for each transfer.
2660 * 0b11..4 x width. The destination address is incremented by 4 times the amount specified by Width for each transfer.
2661 */
2662#define DMA_CHANNEL_XFERCFG_DSTINC(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_DSTINC_SHIFT)) & DMA_CHANNEL_XFERCFG_DSTINC_MASK)
2663#define DMA_CHANNEL_XFERCFG_XFERCOUNT_MASK (0x3FF0000U)
2664#define DMA_CHANNEL_XFERCFG_XFERCOUNT_SHIFT (16U)
2665/*! XFERCOUNT - Total number of transfers to be performed, minus 1 encoded. The number of bytes
2666 * transferred is: (XFERCOUNT + 1) x data width (as defined by the WIDTH field). The DMA controller
2667 * uses this bit field during transfer to count down. Hence, it cannot be used by software to read
2668 * back the size of the transfer, for instance, in an interrupt handler. 0x0 = a total of 1
2669 * transfer will be performed. 0x1 = a total of 2 transfers will be performed. 0x3FF = a total of
2670 * 1,024 transfers will be performed.
2671 */
2672#define DMA_CHANNEL_XFERCFG_XFERCOUNT(x) (((uint32_t)(((uint32_t)(x)) << DMA_CHANNEL_XFERCFG_XFERCOUNT_SHIFT)) & DMA_CHANNEL_XFERCFG_XFERCOUNT_MASK)
2673/*! @} */
2674
2675/* The count of DMA_CHANNEL_XFERCFG */
2676#define DMA_CHANNEL_XFERCFG_COUNT (32U)
2677
2678
2679/*!
2680 * @}
2681 */ /* end of group DMA_Register_Masks */
2682
2683
2684/* DMA - Peripheral instance base addresses */
2685/** Peripheral DMA0 base address */
2686#define DMA0_BASE (0x40082000u)
2687/** Peripheral DMA0 base pointer */
2688#define DMA0 ((DMA_Type *)DMA0_BASE)
2689/** Array initializer of DMA peripheral base addresses */
2690#define DMA_BASE_ADDRS { DMA0_BASE }
2691/** Array initializer of DMA peripheral base pointers */
2692#define DMA_BASE_PTRS { DMA0 }
2693/** Interrupt vectors for the DMA peripheral type */
2694#define DMA_IRQS { DMA0_IRQn }
2695
2696/*!
2697 * @}
2698 */ /* end of group DMA_Peripheral_Access_Layer */
2699
2700
2701/* ----------------------------------------------------------------------------
2702 -- DMIC Peripheral Access Layer
2703 ---------------------------------------------------------------------------- */
2704
2705/*!
2706 * @addtogroup DMIC_Peripheral_Access_Layer DMIC Peripheral Access Layer
2707 * @{
2708 */
2709
2710/** DMIC - Register Layout Typedef */
2711typedef struct {
2712 struct { /* offset: 0x0, array step: 0x100 */
2713 __IO uint32_t OSR; /**< Oversample Rate register 0, array offset: 0x0, array step: 0x100 */
2714 __IO uint32_t DIVHFCLK; /**< DMIC Clock Register 0, array offset: 0x4, array step: 0x100 */
2715 __IO uint32_t PREAC2FSCOEF; /**< Pre-Emphasis Filter Coefficient for 2 FS register, array offset: 0x8, array step: 0x100 */
2716 __IO uint32_t PREAC4FSCOEF; /**< Pre-Emphasis Filter Coefficient for 4 FS register, array offset: 0xC, array step: 0x100 */
2717 __IO uint32_t GAINSHIFT; /**< Decimator Gain Shift register, array offset: 0x10, array step: 0x100 */
2718 uint8_t RESERVED_0[108];
2719 __IO uint32_t FIFO_CTRL; /**< FIFO Control register 0, array offset: 0x80, array step: 0x100 */
2720 __IO uint32_t FIFO_STATUS; /**< FIFO Status register 0, array offset: 0x84, array step: 0x100 */
2721 __IO uint32_t FIFO_DATA; /**< FIFO Data Register 0, array offset: 0x88, array step: 0x100 */
2722 __IO uint32_t PHY_CTRL; /**< PDM Source Configuration register 0, array offset: 0x8C, array step: 0x100 */
2723 __IO uint32_t DC_CTRL; /**< DC Control register 0, array offset: 0x90, array step: 0x100 */
2724 uint8_t RESERVED_1[108];
2725 } CHANNEL[2];
2726 uint8_t RESERVED_0[3328];
2727 __IO uint32_t CHANEN; /**< Channel Enable register, offset: 0xF00 */
2728 uint8_t RESERVED_1[8];
2729 __IO uint32_t IOCFG; /**< I/O Configuration register, offset: 0xF0C */
2730 __IO uint32_t USE2FS; /**< Use 2FS register, offset: 0xF10 */
2731 uint8_t RESERVED_2[108];
2732 __IO uint32_t HWVADGAIN; /**< HWVAD input gain register, offset: 0xF80 */
2733 __IO uint32_t HWVADHPFS; /**< HWVAD filter control register, offset: 0xF84 */
2734 __IO uint32_t HWVADST10; /**< HWVAD control register, offset: 0xF88 */
2735 __IO uint32_t HWVADRSTT; /**< HWVAD filter reset register, offset: 0xF8C */
2736 __IO uint32_t HWVADTHGN; /**< HWVAD noise estimator gain register, offset: 0xF90 */
2737 __IO uint32_t HWVADTHGS; /**< HWVAD signal estimator gain register, offset: 0xF94 */
2738 __I uint32_t HWVADLOWZ; /**< HWVAD noise envelope estimator register, offset: 0xF98 */
2739 uint8_t RESERVED_3[96];
2740 __I uint32_t ID; /**< Module Identification register, offset: 0xFFC */
2741} DMIC_Type;
2742
2743/* ----------------------------------------------------------------------------
2744 -- DMIC Register Masks
2745 ---------------------------------------------------------------------------- */
2746
2747/*!
2748 * @addtogroup DMIC_Register_Masks DMIC Register Masks
2749 * @{
2750 */
2751
2752/*! @name CHANNEL_OSR - Oversample Rate register 0 */
2753/*! @{ */
2754#define DMIC_CHANNEL_OSR_OSR_MASK (0xFFU)
2755#define DMIC_CHANNEL_OSR_OSR_SHIFT (0U)
2756/*! OSR - Selects the oversample rate for the related input channel.
2757 */
2758#define DMIC_CHANNEL_OSR_OSR(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_OSR_OSR_SHIFT)) & DMIC_CHANNEL_OSR_OSR_MASK)
2759/*! @} */
2760
2761/* The count of DMIC_CHANNEL_OSR */
2762#define DMIC_CHANNEL_OSR_COUNT (2U)
2763
2764/*! @name CHANNEL_DIVHFCLK - DMIC Clock Register 0 */
2765/*! @{ */
2766#define DMIC_CHANNEL_DIVHFCLK_PDMDIV_MASK (0xFU)
2767#define DMIC_CHANNEL_DIVHFCLK_PDMDIV_SHIFT (0U)
2768/*! PDMDIV - PDM clock divider value. 0 = divide by 1 1 = divide by 2 2 = divide by 3 3 = divide by
2769 * 4 4 = divide by 6 5 = divide by 8 6 = divide by 12 7 = divide by 16 8 = divide by 24 9 =
2770 * divide by 32 10 = divide by 48 11 = divide by 64 12 = divide by 96 13 = divide by 128 others =
2771 * reserved.
2772 */
2773#define DMIC_CHANNEL_DIVHFCLK_PDMDIV(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_DIVHFCLK_PDMDIV_SHIFT)) & DMIC_CHANNEL_DIVHFCLK_PDMDIV_MASK)
2774/*! @} */
2775
2776/* The count of DMIC_CHANNEL_DIVHFCLK */
2777#define DMIC_CHANNEL_DIVHFCLK_COUNT (2U)
2778
2779/*! @name CHANNEL_PREAC2FSCOEF - Pre-Emphasis Filter Coefficient for 2 FS register */
2780/*! @{ */
2781#define DMIC_CHANNEL_PREAC2FSCOEF_COMP_MASK (0x3U)
2782#define DMIC_CHANNEL_PREAC2FSCOEF_COMP_SHIFT (0U)
2783/*! COMP - Pre-emphasis filer coefficient for 2 FS mode. 0 = Compensation = 0 1 = Compensation = 16
2784 * 2 = Compensation = 15 3 = Compensation = 13
2785 */
2786#define DMIC_CHANNEL_PREAC2FSCOEF_COMP(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_PREAC2FSCOEF_COMP_SHIFT)) & DMIC_CHANNEL_PREAC2FSCOEF_COMP_MASK)
2787/*! @} */
2788
2789/* The count of DMIC_CHANNEL_PREAC2FSCOEF */
2790#define DMIC_CHANNEL_PREAC2FSCOEF_COUNT (2U)
2791
2792/*! @name CHANNEL_PREAC4FSCOEF - Pre-Emphasis Filter Coefficient for 4 FS register */
2793/*! @{ */
2794#define DMIC_CHANNEL_PREAC4FSCOEF_COMP_MASK (0x3U)
2795#define DMIC_CHANNEL_PREAC4FSCOEF_COMP_SHIFT (0U)
2796/*! COMP - Pre-emphasis filer coefficient for 4 FS mode. 0 = Compensation = 0 1 = Compensation = 16
2797 * 2 = Compensation = 15 3 = Compensation = 13
2798 */
2799#define DMIC_CHANNEL_PREAC4FSCOEF_COMP(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_PREAC4FSCOEF_COMP_SHIFT)) & DMIC_CHANNEL_PREAC4FSCOEF_COMP_MASK)
2800/*! @} */
2801
2802/* The count of DMIC_CHANNEL_PREAC4FSCOEF */
2803#define DMIC_CHANNEL_PREAC4FSCOEF_COUNT (2U)
2804
2805/*! @name CHANNEL_GAINSHIFT - Decimator Gain Shift register */
2806/*! @{ */
2807#define DMIC_CHANNEL_GAINSHIFT_GAIN_MASK (0x3FU)
2808#define DMIC_CHANNEL_GAINSHIFT_GAIN_SHIFT (0U)
2809/*! GAIN - Gain control, as a positive or negative (two's complement) number of bits to shift.
2810 */
2811#define DMIC_CHANNEL_GAINSHIFT_GAIN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_GAINSHIFT_GAIN_SHIFT)) & DMIC_CHANNEL_GAINSHIFT_GAIN_MASK)
2812/*! @} */
2813
2814/* The count of DMIC_CHANNEL_GAINSHIFT */
2815#define DMIC_CHANNEL_GAINSHIFT_COUNT (2U)
2816
2817/*! @name CHANNEL_FIFO_CTRL - FIFO Control register 0 */
2818/*! @{ */
2819#define DMIC_CHANNEL_FIFO_CTRL_ENABLE_MASK (0x1U)
2820#define DMIC_CHANNEL_FIFO_CTRL_ENABLE_SHIFT (0U)
2821/*! ENABLE - FIFO enable.
2822 * 0b0..FIFO is not enabled. Enabling a DMIC channel with the FIFO disabled could be useful while data is being
2823 * streamed to the I2S, or in order to avoid a filter settling delay when a channel is re-enabled after a
2824 * period when the data was not needed.
2825 * 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.
2826 */
2827#define DMIC_CHANNEL_FIFO_CTRL_ENABLE(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_CTRL_ENABLE_SHIFT)) & DMIC_CHANNEL_FIFO_CTRL_ENABLE_MASK)
2828#define DMIC_CHANNEL_FIFO_CTRL_RESETN_MASK (0x2U)
2829#define DMIC_CHANNEL_FIFO_CTRL_RESETN_SHIFT (1U)
2830/*! RESETN - FIFO reset.
2831 * 0b0..Reset the FIFO.
2832 * 0b1..Normal operation
2833 */
2834#define DMIC_CHANNEL_FIFO_CTRL_RESETN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_CTRL_RESETN_SHIFT)) & DMIC_CHANNEL_FIFO_CTRL_RESETN_MASK)
2835#define DMIC_CHANNEL_FIFO_CTRL_INTEN_MASK (0x4U)
2836#define DMIC_CHANNEL_FIFO_CTRL_INTEN_SHIFT (2U)
2837/*! INTEN - Interrupt enable.
2838 * 0b0..FIFO level interrupts are not enabled.
2839 * 0b1..FIFO level interrupts are enabled.
2840 */
2841#define DMIC_CHANNEL_FIFO_CTRL_INTEN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_CTRL_INTEN_SHIFT)) & DMIC_CHANNEL_FIFO_CTRL_INTEN_MASK)
2842#define DMIC_CHANNEL_FIFO_CTRL_DMAEN_MASK (0x8U)
2843#define DMIC_CHANNEL_FIFO_CTRL_DMAEN_SHIFT (3U)
2844/*! DMAEN - DMA enable
2845 * 0b0..DMA requests are not enabled.
2846 * 0b1..DMA requests based on FIFO level are enabled.
2847 */
2848#define DMIC_CHANNEL_FIFO_CTRL_DMAEN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_CTRL_DMAEN_SHIFT)) & DMIC_CHANNEL_FIFO_CTRL_DMAEN_MASK)
2849#define DMIC_CHANNEL_FIFO_CTRL_TRIGLVL_MASK (0x1F0000U)
2850#define DMIC_CHANNEL_FIFO_CTRL_TRIGLVL_SHIFT (16U)
2851/*! TRIGLVL - FIFO trigger level. Selects the data trigger level for interrupt or DMA operation. If
2852 * enabled to do so, the FIFO level can wake up the device just enough to perform DMA, then
2853 * return to the reduced power mode See Section 4.5.66 'Hardware Wake-up control register'. 0 =
2854 * trigger when the FIFO has received one entry (is no longer empty). 1 = trigger when the FIFO has
2855 * received two entries. 15 = trigger when the FIFO has received 16 entries (has become full).
2856 */
2857#define DMIC_CHANNEL_FIFO_CTRL_TRIGLVL(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_CTRL_TRIGLVL_SHIFT)) & DMIC_CHANNEL_FIFO_CTRL_TRIGLVL_MASK)
2858/*! @} */
2859
2860/* The count of DMIC_CHANNEL_FIFO_CTRL */
2861#define DMIC_CHANNEL_FIFO_CTRL_COUNT (2U)
2862
2863/*! @name CHANNEL_FIFO_STATUS - FIFO Status register 0 */
2864/*! @{ */
2865#define DMIC_CHANNEL_FIFO_STATUS_INT_MASK (0x1U)
2866#define DMIC_CHANNEL_FIFO_STATUS_INT_SHIFT (0U)
2867/*! INT - Interrupt flag. Asserted when FIFO data reaches the level specified in the FIFOCTRL
2868 * register. Writing a one to this bit clears the flag. Remark: note that the bus clock to the DMIC
2869 * subsystem must be running in order for an interrupt to occur.
2870 */
2871#define DMIC_CHANNEL_FIFO_STATUS_INT(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_STATUS_INT_SHIFT)) & DMIC_CHANNEL_FIFO_STATUS_INT_MASK)
2872#define DMIC_CHANNEL_FIFO_STATUS_OVERRUN_MASK (0x2U)
2873#define DMIC_CHANNEL_FIFO_STATUS_OVERRUN_SHIFT (1U)
2874/*! OVERRUN - Overrun flag. Indicates that a FIFO overflow has occurred at some point. Writing a one
2875 * to this bit clears the flag. This flag does not cause an interrupt.
2876 */
2877#define DMIC_CHANNEL_FIFO_STATUS_OVERRUN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_STATUS_OVERRUN_SHIFT)) & DMIC_CHANNEL_FIFO_STATUS_OVERRUN_MASK)
2878#define DMIC_CHANNEL_FIFO_STATUS_UNDERRUN_MASK (0x4U)
2879#define DMIC_CHANNEL_FIFO_STATUS_UNDERRUN_SHIFT (2U)
2880/*! UNDERRUN - Underrun flag. Indicates that a FIFO underflow has occurred at some point. Writing a one to this bit clears the flag.
2881 */
2882#define DMIC_CHANNEL_FIFO_STATUS_UNDERRUN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_STATUS_UNDERRUN_SHIFT)) & DMIC_CHANNEL_FIFO_STATUS_UNDERRUN_MASK)
2883/*! @} */
2884
2885/* The count of DMIC_CHANNEL_FIFO_STATUS */
2886#define DMIC_CHANNEL_FIFO_STATUS_COUNT (2U)
2887
2888/*! @name CHANNEL_FIFO_DATA - FIFO Data Register 0 */
2889/*! @{ */
2890#define DMIC_CHANNEL_FIFO_DATA_DATA_MASK (0xFFFFFFU)
2891#define DMIC_CHANNEL_FIFO_DATA_DATA_SHIFT (0U)
2892/*! DATA - Data from the top of the input filter FIFO.
2893 */
2894#define DMIC_CHANNEL_FIFO_DATA_DATA(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_FIFO_DATA_DATA_SHIFT)) & DMIC_CHANNEL_FIFO_DATA_DATA_MASK)
2895/*! @} */
2896
2897/* The count of DMIC_CHANNEL_FIFO_DATA */
2898#define DMIC_CHANNEL_FIFO_DATA_COUNT (2U)
2899
2900/*! @name CHANNEL_PHY_CTRL - PDM Source Configuration register 0 */
2901/*! @{ */
2902#define DMIC_CHANNEL_PHY_CTRL_PHY_FALL_MASK (0x1U)
2903#define DMIC_CHANNEL_PHY_CTRL_PHY_FALL_SHIFT (0U)
2904/*! PHY_FALL - Capture PDM_DATA
2905 * 0b0..Capture PDM_DATA on the rising edge of PDM_CLK.
2906 * 0b1..Capture PDM_DATA on the falling edge of PDM_CLK.
2907 */
2908#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)
2909#define DMIC_CHANNEL_PHY_CTRL_PHY_HALF_MASK (0x2U)
2910#define DMIC_CHANNEL_PHY_CTRL_PHY_HALF_SHIFT (1U)
2911/*! PHY_HALF - Half rate sampling
2912 * 0b0..Standard half rate sampling. The clock to the DMIC is sent at the same rate as the decimator is providing.
2913 * 0b1..Use half rate sampling. The clock to the DMIC is sent at half the rate as the decimator is providing.
2914 */
2915#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)
2916/*! @} */
2917
2918/* The count of DMIC_CHANNEL_PHY_CTRL */
2919#define DMIC_CHANNEL_PHY_CTRL_COUNT (2U)
2920
2921/*! @name CHANNEL_DC_CTRL - DC Control register 0 */
2922/*! @{ */
2923#define DMIC_CHANNEL_DC_CTRL_DCPOLE_MASK (0x3U)
2924#define DMIC_CHANNEL_DC_CTRL_DCPOLE_SHIFT (0U)
2925/*! DCPOLE - DC block filter
2926 * 0b00..Flat response, no filter.
2927 * 0b01..155 Hz.
2928 * 0b10..78 Hz.
2929 * 0b11..39 Hz
2930 */
2931#define DMIC_CHANNEL_DC_CTRL_DCPOLE(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_DC_CTRL_DCPOLE_SHIFT)) & DMIC_CHANNEL_DC_CTRL_DCPOLE_MASK)
2932#define DMIC_CHANNEL_DC_CTRL_DCGAIN_MASK (0xF0U)
2933#define DMIC_CHANNEL_DC_CTRL_DCGAIN_SHIFT (4U)
2934/*! DCGAIN - Fine gain adjustment in the form of a number of bits to downshift.
2935 */
2936#define DMIC_CHANNEL_DC_CTRL_DCGAIN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_DC_CTRL_DCGAIN_SHIFT)) & DMIC_CHANNEL_DC_CTRL_DCGAIN_MASK)
2937#define DMIC_CHANNEL_DC_CTRL_SATURATEAT16BIT_MASK (0x100U)
2938#define DMIC_CHANNEL_DC_CTRL_SATURATEAT16BIT_SHIFT (8U)
2939/*! SATURATEAT16BIT - Selects 16-bit saturation.
2940 * 0b0..Results roll over if out range and do not saturate.
2941 * 0b1..If the result overflows, it saturates at 0xFFFF for positive overflow and 0x8000 for negative overflow.
2942 */
2943#define DMIC_CHANNEL_DC_CTRL_SATURATEAT16BIT(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANNEL_DC_CTRL_SATURATEAT16BIT_SHIFT)) & DMIC_CHANNEL_DC_CTRL_SATURATEAT16BIT_MASK)
2944/*! @} */
2945
2946/* The count of DMIC_CHANNEL_DC_CTRL */
2947#define DMIC_CHANNEL_DC_CTRL_COUNT (2U)
2948
2949/*! @name CHANEN - Channel Enable register */
2950/*! @{ */
2951#define DMIC_CHANEN_EN_CH0_MASK (0x1U)
2952#define DMIC_CHANEN_EN_CH0_SHIFT (0U)
2953/*! EN_CH0 - Enable channel 0. When 1, PDM channel 0 is enabled.
2954 */
2955#define DMIC_CHANEN_EN_CH0(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANEN_EN_CH0_SHIFT)) & DMIC_CHANEN_EN_CH0_MASK)
2956#define DMIC_CHANEN_EN_CH1_MASK (0x2U)
2957#define DMIC_CHANEN_EN_CH1_SHIFT (1U)
2958/*! EN_CH1 - Enable channel 1. When 1, PDM channel 1 is enabled.
2959 */
2960#define DMIC_CHANEN_EN_CH1(x) (((uint32_t)(((uint32_t)(x)) << DMIC_CHANEN_EN_CH1_SHIFT)) & DMIC_CHANEN_EN_CH1_MASK)
2961/*! @} */
2962
2963/*! @name IOCFG - I/O Configuration register */
2964/*! @{ */
2965#define DMIC_IOCFG_CLK_BYPASS0_MASK (0x1U)
2966#define DMIC_IOCFG_CLK_BYPASS0_SHIFT (0U)
2967/*! CLK_BYPASS0 - Bypass CLK0. When 1, PDM_DATA1 becomes the clock for PDM channel 0. This provides
2968 * for the possibility of an external codec taking over the PDM bus.
2969 */
2970#define DMIC_IOCFG_CLK_BYPASS0(x) (((uint32_t)(((uint32_t)(x)) << DMIC_IOCFG_CLK_BYPASS0_SHIFT)) & DMIC_IOCFG_CLK_BYPASS0_MASK)
2971#define DMIC_IOCFG_CLK_BYPASS1_MASK (0x2U)
2972#define DMIC_IOCFG_CLK_BYPASS1_SHIFT (1U)
2973/*! CLK_BYPASS1 - Bypass CLK1. When 1, PDM_DATA1 becomes the clock for PDM channel 1. This provides
2974 * for the possibility of an external codec taking over the PDM bus.
2975 */
2976#define DMIC_IOCFG_CLK_BYPASS1(x) (((uint32_t)(((uint32_t)(x)) << DMIC_IOCFG_CLK_BYPASS1_SHIFT)) & DMIC_IOCFG_CLK_BYPASS1_MASK)
2977#define DMIC_IOCFG_STEREO_DATA0_MASK (0x4U)
2978#define DMIC_IOCFG_STEREO_DATA0_SHIFT (2U)
2979/*! STEREO_DATA0 - Stereo PDM select. When 1, PDM_DATA0 is routed to both PDM channels in a
2980 * configuration that supports a single stereo digital microphone.
2981 */
2982#define DMIC_IOCFG_STEREO_DATA0(x) (((uint32_t)(((uint32_t)(x)) << DMIC_IOCFG_STEREO_DATA0_SHIFT)) & DMIC_IOCFG_STEREO_DATA0_MASK)
2983/*! @} */
2984
2985/*! @name USE2FS - Use 2FS register */
2986/*! @{ */
2987#define DMIC_USE2FS_USE2FS_MASK (0x1U)
2988#define DMIC_USE2FS_USE2FS_SHIFT (0U)
2989/*! USE2FS - Use 2FS register
2990 * 0b0..Use 1FS output for PCM data.
2991 * 0b1..Use 2FS output for PCM data.
2992 */
2993#define DMIC_USE2FS_USE2FS(x) (((uint32_t)(((uint32_t)(x)) << DMIC_USE2FS_USE2FS_SHIFT)) & DMIC_USE2FS_USE2FS_MASK)
2994/*! @} */
2995
2996/*! @name HWVADGAIN - HWVAD input gain register */
2997/*! @{ */
2998#define DMIC_HWVADGAIN_INPUTGAIN_MASK (0xFU)
2999#define DMIC_HWVADGAIN_INPUTGAIN_SHIFT (0U)
3000/*! INPUTGAIN - Shift value for input bits 0x00 -10 bits 0x01 -8 bits 0x02 -6 bits 0x03 -4 bits 0x04
3001 * -2 bits 0x05 0 bits (default) 0x06 +2 bits 0x07 +4 bits 0x08 +6 bits 0x09 +8 bits 0x0A +10
3002 * bits 0x0B +12 bits 0x0C +14 bits 0x0D to 0x0F Reserved.
3003 */
3004#define DMIC_HWVADGAIN_INPUTGAIN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADGAIN_INPUTGAIN_SHIFT)) & DMIC_HWVADGAIN_INPUTGAIN_MASK)
3005/*! @} */
3006
3007/*! @name HWVADHPFS - HWVAD filter control register */
3008/*! @{ */
3009#define DMIC_HWVADHPFS_HPFS_MASK (0x3U)
3010#define DMIC_HWVADHPFS_HPFS_SHIFT (0U)
3011/*! HPFS - High pass filter
3012 * 0b00..First filter by-pass.
3013 * 0b01..High pass filter with -3dB cut-off at 1750Hz.
3014 * 0b10..High pass filter with -3dB cut-off at 215Hz.
3015 * 0b11..Reserved.
3016 */
3017#define DMIC_HWVADHPFS_HPFS(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADHPFS_HPFS_SHIFT)) & DMIC_HWVADHPFS_HPFS_MASK)
3018/*! @} */
3019
3020/*! @name HWVADST10 - HWVAD control register */
3021/*! @{ */
3022#define DMIC_HWVADST10_ST10_MASK (0x1U)
3023#define DMIC_HWVADST10_ST10_SHIFT (0U)
3024/*! ST10 - Stage 0
3025 * 0b0..Normal operation, waiting for HWVAD trigger event (stage 0).
3026 * 0b1..Reset internal interrupt flag by writing a '1' pulse.
3027 */
3028#define DMIC_HWVADST10_ST10(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADST10_ST10_SHIFT)) & DMIC_HWVADST10_ST10_MASK)
3029/*! @} */
3030
3031/*! @name HWVADRSTT - HWVAD filter reset register */
3032/*! @{ */
3033#define DMIC_HWVADRSTT_RSTT_MASK (0x1U)
3034#define DMIC_HWVADRSTT_RSTT_SHIFT (0U)
3035/*! RSTT - Writing a 1 resets all filter values
3036 */
3037#define DMIC_HWVADRSTT_RSTT(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADRSTT_RSTT_SHIFT)) & DMIC_HWVADRSTT_RSTT_MASK)
3038/*! @} */
3039
3040/*! @name HWVADTHGN - HWVAD noise estimator gain register */
3041/*! @{ */
3042#define DMIC_HWVADTHGN_THGN_MASK (0xFU)
3043#define DMIC_HWVADTHGN_THGN_SHIFT (0U)
3044/*! THGN - Gain value for the noise estimator. Values 0 to 14. 0 corresponds to a gain of 1.
3045 */
3046#define DMIC_HWVADTHGN_THGN(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADTHGN_THGN_SHIFT)) & DMIC_HWVADTHGN_THGN_MASK)
3047/*! @} */
3048
3049/*! @name HWVADTHGS - HWVAD signal estimator gain register */
3050/*! @{ */
3051#define DMIC_HWVADTHGS_THGS_MASK (0xFU)
3052#define DMIC_HWVADTHGS_THGS_SHIFT (0U)
3053/*! THGS - Gain value for the signal estimator. Values 0 to 14. 0 corresponds to a gain of 1.
3054 */
3055#define DMIC_HWVADTHGS_THGS(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADTHGS_THGS_SHIFT)) & DMIC_HWVADTHGS_THGS_MASK)
3056/*! @} */
3057
3058/*! @name HWVADLOWZ - HWVAD noise envelope estimator register */
3059/*! @{ */
3060#define DMIC_HWVADLOWZ_LOWZ_MASK (0xFFFFU)
3061#define DMIC_HWVADLOWZ_LOWZ_SHIFT (0U)
3062/*! LOWZ - Noise envelope estimator value.
3063 */
3064#define DMIC_HWVADLOWZ_LOWZ(x) (((uint32_t)(((uint32_t)(x)) << DMIC_HWVADLOWZ_LOWZ_SHIFT)) & DMIC_HWVADLOWZ_LOWZ_MASK)
3065/*! @} */
3066
3067/*! @name ID - Module Identification register */
3068/*! @{ */
3069#define DMIC_ID_ID_MASK (0xFFFFFFFFU)
3070#define DMIC_ID_ID_SHIFT (0U)
3071/*! ID - Indicates module ID and the number of channels in this DMIC interface.
3072 */
3073#define DMIC_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << DMIC_ID_ID_SHIFT)) & DMIC_ID_ID_MASK)
3074/*! @} */
3075
3076
3077/*!
3078 * @}
3079 */ /* end of group DMIC_Register_Masks */
3080
3081
3082/* DMIC - Peripheral instance base addresses */
3083/** Peripheral DMIC0 base address */
3084#define DMIC0_BASE (0x40090000u)
3085/** Peripheral DMIC0 base pointer */
3086#define DMIC0 ((DMIC_Type *)DMIC0_BASE)
3087/** Array initializer of DMIC peripheral base addresses */
3088#define DMIC_BASE_ADDRS { DMIC0_BASE }
3089/** Array initializer of DMIC peripheral base pointers */
3090#define DMIC_BASE_PTRS { DMIC0 }
3091/** Interrupt vectors for the DMIC peripheral type */
3092#define DMIC_IRQS { DMIC0_IRQn }
3093#define DMIC_HWVAD_IRQS { HWVAD0_IRQn }
3094
3095/*!
3096 * @}
3097 */ /* end of group DMIC_Peripheral_Access_Layer */
3098
3099
3100/* ----------------------------------------------------------------------------
3101 -- EMC Peripheral Access Layer
3102 ---------------------------------------------------------------------------- */
3103
3104/*!
3105 * @addtogroup EMC_Peripheral_Access_Layer EMC Peripheral Access Layer
3106 * @{
3107 */
3108
3109/** EMC - Register Layout Typedef */
3110typedef struct {
3111 __IO uint32_t CONTROL; /**< Controls operation of the memory controller, offset: 0x0 */
3112 __I uint32_t STATUS; /**< Provides EMC status information, offset: 0x4 */
3113 __IO uint32_t CONFIG; /**< Configures operation of the memory controller, offset: 0x8 */
3114 uint8_t RESERVED_0[20];
3115 __IO uint32_t DYNAMICCONTROL; /**< Controls dynamic memory operation, offset: 0x20 */
3116 __IO uint32_t DYNAMICREFRESH; /**< Configures dynamic memory refresh, offset: 0x24 */
3117 __IO uint32_t DYNAMICREADCONFIG; /**< Configures dynamic memory read strategy, offset: 0x28 */
3118 uint8_t RESERVED_1[4];
3119 __IO uint32_t DYNAMICRP; /**< Precharge command period, offset: 0x30 */
3120 __IO uint32_t DYNAMICRAS; /**< Active to precharge command period, offset: 0x34 */
3121 __IO uint32_t DYNAMICSREX; /**< Self-refresh exit time, offset: 0x38 */
3122 __IO uint32_t DYNAMICAPR; /**< Last-data-out to active command time, offset: 0x3C */
3123 __IO uint32_t DYNAMICDAL; /**< Data-in to active command time, offset: 0x40 */
3124 __IO uint32_t DYNAMICWR; /**< Write recovery time, offset: 0x44 */
3125 __IO uint32_t DYNAMICRC; /**< Selects the active to active command period, offset: 0x48 */
3126 __IO uint32_t DYNAMICRFC; /**< Selects the auto-refresh period, offset: 0x4C */
3127 __IO uint32_t DYNAMICXSR; /**< Time for exit self-refresh to active command, offset: 0x50 */
3128 __IO uint32_t DYNAMICRRD; /**< Latency for active bank A to active bank B, offset: 0x54 */
3129 __IO uint32_t DYNAMICMRD; /**< Time for load mode register to active command, offset: 0x58 */
3130 uint8_t RESERVED_2[36];
3131 __IO uint32_t STATICEXTENDEDWAIT; /**< Time for long static memory read and write transfers, offset: 0x80 */
3132 uint8_t RESERVED_3[124];
3133 struct { /* offset: 0x100, array step: 0x20 */
3134 __IO uint32_t DYNAMICCONFIG; /**< Configuration information for EMC_DYCSx, array offset: 0x100, array step: 0x20 */
3135 __IO uint32_t DYNAMICRASCAS; /**< RAS and CAS latencies for EMC_DYCSx, array offset: 0x104, array step: 0x20 */
3136 uint8_t RESERVED_0[24];
3137 } DYNAMIC[4];
3138 uint8_t RESERVED_4[128];
3139 struct { /* offset: 0x200, array step: 0x20 */
3140 __IO uint32_t STATICCONFIG; /**< Configuration for EMC_CSx, array offset: 0x200, array step: 0x20 */
3141 __IO uint32_t STATICWAITWEN; /**< Delay from EMC_CSx to write enable, array offset: 0x204, array step: 0x20 */
3142 __IO uint32_t STATICWAITOEN; /**< Delay from EMC_CSx or address change, whichever is later, to output enable, array offset: 0x208, array step: 0x20 */
3143 __IO uint32_t STATICWAITRD; /**< Delay from EMC_CSx to a read access, array offset: 0x20C, array step: 0x20 */
3144 __IO uint32_t STATICWAITPAGE; /**< Delay for asynchronous page mode sequential accesses for EMC_CSx, array offset: 0x210, array step: 0x20 */
3145 __IO uint32_t STATICWAITWR; /**< Delay from EMC_CSx to a write access, array offset: 0x214, array step: 0x20 */
3146 __IO uint32_t STATICWAITTURN; /**< Number of bus turnaround cycles EMC_CSx, array offset: 0x218, array step: 0x20 */
3147 uint8_t RESERVED_0[4];
3148 } STATIC[4];
3149} EMC_Type;
3150
3151/* ----------------------------------------------------------------------------
3152 -- EMC Register Masks
3153 ---------------------------------------------------------------------------- */
3154
3155/*!
3156 * @addtogroup EMC_Register_Masks EMC Register Masks
3157 * @{
3158 */
3159
3160/*! @name CONTROL - Controls operation of the memory controller */
3161/*! @{ */
3162#define EMC_CONTROL_E_MASK (0x1U)
3163#define EMC_CONTROL_E_SHIFT (0U)
3164/*! E - EMC Enable.
3165 */
3166#define EMC_CONTROL_E(x) (((uint32_t)(((uint32_t)(x)) << EMC_CONTROL_E_SHIFT)) & EMC_CONTROL_E_MASK)
3167#define EMC_CONTROL_M_MASK (0x2U)
3168#define EMC_CONTROL_M_SHIFT (1U)
3169/*! M - Address mirror.
3170 */
3171#define EMC_CONTROL_M(x) (((uint32_t)(((uint32_t)(x)) << EMC_CONTROL_M_SHIFT)) & EMC_CONTROL_M_MASK)
3172#define EMC_CONTROL_L_MASK (0x4U)
3173#define EMC_CONTROL_L_SHIFT (2U)
3174/*! L - Low-power mode.
3175 */
3176#define EMC_CONTROL_L(x) (((uint32_t)(((uint32_t)(x)) << EMC_CONTROL_L_SHIFT)) & EMC_CONTROL_L_MASK)
3177/*! @} */
3178
3179/*! @name STATUS - Provides EMC status information */
3180/*! @{ */
3181#define EMC_STATUS_B_MASK (0x1U)
3182#define EMC_STATUS_B_SHIFT (0U)
3183/*! B - Busy.
3184 */
3185#define EMC_STATUS_B(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATUS_B_SHIFT)) & EMC_STATUS_B_MASK)
3186#define EMC_STATUS_S_MASK (0x2U)
3187#define EMC_STATUS_S_SHIFT (1U)
3188/*! S - Write buffer status.
3189 */
3190#define EMC_STATUS_S(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATUS_S_SHIFT)) & EMC_STATUS_S_MASK)
3191#define EMC_STATUS_SA_MASK (0x4U)
3192#define EMC_STATUS_SA_SHIFT (2U)
3193/*! SA - Self-refresh acknowledge.
3194 */
3195#define EMC_STATUS_SA(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATUS_SA_SHIFT)) & EMC_STATUS_SA_MASK)
3196/*! @} */
3197
3198/*! @name CONFIG - Configures operation of the memory controller */
3199/*! @{ */
3200#define EMC_CONFIG_EM_MASK (0x1U)
3201#define EMC_CONFIG_EM_SHIFT (0U)
3202/*! EM - Endian mode.
3203 */
3204#define EMC_CONFIG_EM(x) (((uint32_t)(((uint32_t)(x)) << EMC_CONFIG_EM_SHIFT)) & EMC_CONFIG_EM_MASK)
3205#define EMC_CONFIG_CLKR_MASK (0x100U)
3206#define EMC_CONFIG_CLKR_SHIFT (8U)
3207/*! CLKR - This bit must contain 0 for proper operation of the EMC.
3208 */
3209#define EMC_CONFIG_CLKR(x) (((uint32_t)(((uint32_t)(x)) << EMC_CONFIG_CLKR_SHIFT)) & EMC_CONFIG_CLKR_MASK)
3210/*! @} */
3211
3212/*! @name DYNAMICCONTROL - Controls dynamic memory operation */
3213/*! @{ */
3214#define EMC_DYNAMICCONTROL_CE_MASK (0x1U)
3215#define EMC_DYNAMICCONTROL_CE_SHIFT (0U)
3216/*! CE - Dynamic memory clock enable.
3217 */
3218#define EMC_DYNAMICCONTROL_CE(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICCONTROL_CE_SHIFT)) & EMC_DYNAMICCONTROL_CE_MASK)
3219#define EMC_DYNAMICCONTROL_CS_MASK (0x2U)
3220#define EMC_DYNAMICCONTROL_CS_SHIFT (1U)
3221/*! CS - Dynamic memory clock control.
3222 */
3223#define EMC_DYNAMICCONTROL_CS(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICCONTROL_CS_SHIFT)) & EMC_DYNAMICCONTROL_CS_MASK)
3224#define EMC_DYNAMICCONTROL_SR_MASK (0x4U)
3225#define EMC_DYNAMICCONTROL_SR_SHIFT (2U)
3226/*! SR - Self-refresh request, EMCSREFREQ.
3227 */
3228#define EMC_DYNAMICCONTROL_SR(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICCONTROL_SR_SHIFT)) & EMC_DYNAMICCONTROL_SR_MASK)
3229#define EMC_DYNAMICCONTROL_MMC_MASK (0x20U)
3230#define EMC_DYNAMICCONTROL_MMC_SHIFT (5U)
3231/*! MMC - Memory clock control.
3232 */
3233#define EMC_DYNAMICCONTROL_MMC(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICCONTROL_MMC_SHIFT)) & EMC_DYNAMICCONTROL_MMC_MASK)
3234#define EMC_DYNAMICCONTROL_I_MASK (0x180U)
3235#define EMC_DYNAMICCONTROL_I_SHIFT (7U)
3236/*! I - SDRAM initialization.
3237 */
3238#define EMC_DYNAMICCONTROL_I(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICCONTROL_I_SHIFT)) & EMC_DYNAMICCONTROL_I_MASK)
3239/*! @} */
3240
3241/*! @name DYNAMICREFRESH - Configures dynamic memory refresh */
3242/*! @{ */
3243#define EMC_DYNAMICREFRESH_REFRESH_MASK (0x7FFU)
3244#define EMC_DYNAMICREFRESH_REFRESH_SHIFT (0U)
3245/*! REFRESH - Refresh timer.
3246 */
3247#define EMC_DYNAMICREFRESH_REFRESH(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICREFRESH_REFRESH_SHIFT)) & EMC_DYNAMICREFRESH_REFRESH_MASK)
3248/*! @} */
3249
3250/*! @name DYNAMICREADCONFIG - Configures dynamic memory read strategy */
3251/*! @{ */
3252#define EMC_DYNAMICREADCONFIG_RD_MASK (0x3U)
3253#define EMC_DYNAMICREADCONFIG_RD_SHIFT (0U)
3254/*! RD - Read data strategy.
3255 */
3256#define EMC_DYNAMICREADCONFIG_RD(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICREADCONFIG_RD_SHIFT)) & EMC_DYNAMICREADCONFIG_RD_MASK)
3257/*! @} */
3258
3259/*! @name DYNAMICRP - Precharge command period */
3260/*! @{ */
3261#define EMC_DYNAMICRP_TRP_MASK (0xFU)
3262#define EMC_DYNAMICRP_TRP_SHIFT (0U)
3263/*! TRP - Precharge command period.
3264 */
3265#define EMC_DYNAMICRP_TRP(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICRP_TRP_SHIFT)) & EMC_DYNAMICRP_TRP_MASK)
3266/*! @} */
3267
3268/*! @name DYNAMICRAS - Active to precharge command period */
3269/*! @{ */
3270#define EMC_DYNAMICRAS_TRAS_MASK (0xFU)
3271#define EMC_DYNAMICRAS_TRAS_SHIFT (0U)
3272/*! TRAS - Active to precharge command period.
3273 */
3274#define EMC_DYNAMICRAS_TRAS(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICRAS_TRAS_SHIFT)) & EMC_DYNAMICRAS_TRAS_MASK)
3275/*! @} */
3276
3277/*! @name DYNAMICSREX - Self-refresh exit time */
3278/*! @{ */
3279#define EMC_DYNAMICSREX_TSREX_MASK (0xFU)
3280#define EMC_DYNAMICSREX_TSREX_SHIFT (0U)
3281/*! TSREX - Self-refresh exit time.
3282 */
3283#define EMC_DYNAMICSREX_TSREX(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICSREX_TSREX_SHIFT)) & EMC_DYNAMICSREX_TSREX_MASK)
3284/*! @} */
3285
3286/*! @name DYNAMICAPR - Last-data-out to active command time */
3287/*! @{ */
3288#define EMC_DYNAMICAPR_TAPR_MASK (0xFU)
3289#define EMC_DYNAMICAPR_TAPR_SHIFT (0U)
3290/*! TAPR - Last-data-out to active command time.
3291 */
3292#define EMC_DYNAMICAPR_TAPR(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICAPR_TAPR_SHIFT)) & EMC_DYNAMICAPR_TAPR_MASK)
3293/*! @} */
3294
3295/*! @name DYNAMICDAL - Data-in to active command time */
3296/*! @{ */
3297#define EMC_DYNAMICDAL_TDAL_MASK (0xFU)
3298#define EMC_DYNAMICDAL_TDAL_SHIFT (0U)
3299/*! TDAL - Data-in to active command.
3300 */
3301#define EMC_DYNAMICDAL_TDAL(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICDAL_TDAL_SHIFT)) & EMC_DYNAMICDAL_TDAL_MASK)
3302/*! @} */
3303
3304/*! @name DYNAMICWR - Write recovery time */
3305/*! @{ */
3306#define EMC_DYNAMICWR_TWR_MASK (0xFU)
3307#define EMC_DYNAMICWR_TWR_SHIFT (0U)
3308/*! TWR - Write recovery time.
3309 */
3310#define EMC_DYNAMICWR_TWR(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICWR_TWR_SHIFT)) & EMC_DYNAMICWR_TWR_MASK)
3311/*! @} */
3312
3313/*! @name DYNAMICRC - Selects the active to active command period */
3314/*! @{ */
3315#define EMC_DYNAMICRC_TRC_MASK (0x1FU)
3316#define EMC_DYNAMICRC_TRC_SHIFT (0U)
3317/*! TRC - Active to active command period.
3318 */
3319#define EMC_DYNAMICRC_TRC(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICRC_TRC_SHIFT)) & EMC_DYNAMICRC_TRC_MASK)
3320/*! @} */
3321
3322/*! @name DYNAMICRFC - Selects the auto-refresh period */
3323/*! @{ */
3324#define EMC_DYNAMICRFC_TRFC_MASK (0x1FU)
3325#define EMC_DYNAMICRFC_TRFC_SHIFT (0U)
3326/*! TRFC - Auto-refresh period and auto-refresh to active command period.
3327 */
3328#define EMC_DYNAMICRFC_TRFC(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICRFC_TRFC_SHIFT)) & EMC_DYNAMICRFC_TRFC_MASK)
3329/*! @} */
3330
3331/*! @name DYNAMICXSR - Time for exit self-refresh to active command */
3332/*! @{ */
3333#define EMC_DYNAMICXSR_TXSR_MASK (0x1FU)
3334#define EMC_DYNAMICXSR_TXSR_SHIFT (0U)
3335/*! TXSR - Exit self-refresh to active command time.
3336 */
3337#define EMC_DYNAMICXSR_TXSR(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICXSR_TXSR_SHIFT)) & EMC_DYNAMICXSR_TXSR_MASK)
3338/*! @} */
3339
3340/*! @name DYNAMICRRD - Latency for active bank A to active bank B */
3341/*! @{ */
3342#define EMC_DYNAMICRRD_TRRD_MASK (0xFU)
3343#define EMC_DYNAMICRRD_TRRD_SHIFT (0U)
3344/*! TRRD - Active bank A to active bank B latency 0x0 - 0xE = n + 1 clock cycles.
3345 */
3346#define EMC_DYNAMICRRD_TRRD(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICRRD_TRRD_SHIFT)) & EMC_DYNAMICRRD_TRRD_MASK)
3347/*! @} */
3348
3349/*! @name DYNAMICMRD - Time for load mode register to active command */
3350/*! @{ */
3351#define EMC_DYNAMICMRD_TMRD_MASK (0xFU)
3352#define EMC_DYNAMICMRD_TMRD_SHIFT (0U)
3353/*! TMRD - Load mode register to active command time.
3354 */
3355#define EMC_DYNAMICMRD_TMRD(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMICMRD_TMRD_SHIFT)) & EMC_DYNAMICMRD_TMRD_MASK)
3356/*! @} */
3357
3358/*! @name STATICEXTENDEDWAIT - Time for long static memory read and write transfers */
3359/*! @{ */
3360#define EMC_STATICEXTENDEDWAIT_EXTENDEDWAIT_MASK (0x3FFU)
3361#define EMC_STATICEXTENDEDWAIT_EXTENDEDWAIT_SHIFT (0U)
3362/*! EXTENDEDWAIT - Extended wait time out.
3363 */
3364#define EMC_STATICEXTENDEDWAIT_EXTENDEDWAIT(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATICEXTENDEDWAIT_EXTENDEDWAIT_SHIFT)) & EMC_STATICEXTENDEDWAIT_EXTENDEDWAIT_MASK)
3365/*! @} */
3366
3367/*! @name DYNAMIC_DYNAMICCONFIG - Configuration information for EMC_DYCSx */
3368/*! @{ */
3369#define EMC_DYNAMIC_DYNAMICCONFIG_MD_MASK (0x18U)
3370#define EMC_DYNAMIC_DYNAMICCONFIG_MD_SHIFT (3U)
3371/*! MD - Memory device.
3372 */
3373#define EMC_DYNAMIC_DYNAMICCONFIG_MD(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMIC_DYNAMICCONFIG_MD_SHIFT)) & EMC_DYNAMIC_DYNAMICCONFIG_MD_MASK)
3374#define EMC_DYNAMIC_DYNAMICCONFIG_AM0_MASK (0x1F80U)
3375#define EMC_DYNAMIC_DYNAMICCONFIG_AM0_SHIFT (7U)
3376/*! AM0 - See Table 933.
3377 */
3378#define EMC_DYNAMIC_DYNAMICCONFIG_AM0(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMIC_DYNAMICCONFIG_AM0_SHIFT)) & EMC_DYNAMIC_DYNAMICCONFIG_AM0_MASK)
3379#define EMC_DYNAMIC_DYNAMICCONFIG_AM1_MASK (0x4000U)
3380#define EMC_DYNAMIC_DYNAMICCONFIG_AM1_SHIFT (14U)
3381/*! AM1 - See Table 933.
3382 */
3383#define EMC_DYNAMIC_DYNAMICCONFIG_AM1(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMIC_DYNAMICCONFIG_AM1_SHIFT)) & EMC_DYNAMIC_DYNAMICCONFIG_AM1_MASK)
3384#define EMC_DYNAMIC_DYNAMICCONFIG_B_MASK (0x80000U)
3385#define EMC_DYNAMIC_DYNAMICCONFIG_B_SHIFT (19U)
3386/*! B - Buffer enable.
3387 */
3388#define EMC_DYNAMIC_DYNAMICCONFIG_B(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMIC_DYNAMICCONFIG_B_SHIFT)) & EMC_DYNAMIC_DYNAMICCONFIG_B_MASK)
3389#define EMC_DYNAMIC_DYNAMICCONFIG_P_MASK (0x100000U)
3390#define EMC_DYNAMIC_DYNAMICCONFIG_P_SHIFT (20U)
3391/*! P - Write protect.
3392 */
3393#define EMC_DYNAMIC_DYNAMICCONFIG_P(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMIC_DYNAMICCONFIG_P_SHIFT)) & EMC_DYNAMIC_DYNAMICCONFIG_P_MASK)
3394/*! @} */
3395
3396/* The count of EMC_DYNAMIC_DYNAMICCONFIG */
3397#define EMC_DYNAMIC_DYNAMICCONFIG_COUNT (4U)
3398
3399/*! @name DYNAMIC_DYNAMICRASCAS - RAS and CAS latencies for EMC_DYCSx */
3400/*! @{ */
3401#define EMC_DYNAMIC_DYNAMICRASCAS_RAS_MASK (0x3U)
3402#define EMC_DYNAMIC_DYNAMICRASCAS_RAS_SHIFT (0U)
3403/*! RAS - RAS latency (active to read/write delay).
3404 */
3405#define EMC_DYNAMIC_DYNAMICRASCAS_RAS(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMIC_DYNAMICRASCAS_RAS_SHIFT)) & EMC_DYNAMIC_DYNAMICRASCAS_RAS_MASK)
3406#define EMC_DYNAMIC_DYNAMICRASCAS_CAS_MASK (0x300U)
3407#define EMC_DYNAMIC_DYNAMICRASCAS_CAS_SHIFT (8U)
3408/*! CAS - CAS latency.
3409 */
3410#define EMC_DYNAMIC_DYNAMICRASCAS_CAS(x) (((uint32_t)(((uint32_t)(x)) << EMC_DYNAMIC_DYNAMICRASCAS_CAS_SHIFT)) & EMC_DYNAMIC_DYNAMICRASCAS_CAS_MASK)
3411/*! @} */
3412
3413/* The count of EMC_DYNAMIC_DYNAMICRASCAS */
3414#define EMC_DYNAMIC_DYNAMICRASCAS_COUNT (4U)
3415
3416/*! @name STATIC_STATICCONFIG - Configuration for EMC_CSx */
3417/*! @{ */
3418#define EMC_STATIC_STATICCONFIG_MW_MASK (0x3U)
3419#define EMC_STATIC_STATICCONFIG_MW_SHIFT (0U)
3420/*! MW - Memory width.
3421 */
3422#define EMC_STATIC_STATICCONFIG_MW(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATIC_STATICCONFIG_MW_SHIFT)) & EMC_STATIC_STATICCONFIG_MW_MASK)
3423#define EMC_STATIC_STATICCONFIG_PM_MASK (0x8U)
3424#define EMC_STATIC_STATICCONFIG_PM_SHIFT (3U)
3425/*! PM - Page mode.
3426 */
3427#define EMC_STATIC_STATICCONFIG_PM(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATIC_STATICCONFIG_PM_SHIFT)) & EMC_STATIC_STATICCONFIG_PM_MASK)
3428#define EMC_STATIC_STATICCONFIG_PC_MASK (0x40U)
3429#define EMC_STATIC_STATICCONFIG_PC_SHIFT (6U)
3430/*! PC - Chip select polarity.
3431 */
3432#define EMC_STATIC_STATICCONFIG_PC(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATIC_STATICCONFIG_PC_SHIFT)) & EMC_STATIC_STATICCONFIG_PC_MASK)
3433#define EMC_STATIC_STATICCONFIG_PB_MASK (0x80U)
3434#define EMC_STATIC_STATICCONFIG_PB_SHIFT (7U)
3435/*! PB - Byte lane state.
3436 */
3437#define EMC_STATIC_STATICCONFIG_PB(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATIC_STATICCONFIG_PB_SHIFT)) & EMC_STATIC_STATICCONFIG_PB_MASK)
3438#define EMC_STATIC_STATICCONFIG_EW_MASK (0x100U)
3439#define EMC_STATIC_STATICCONFIG_EW_SHIFT (8U)
3440/*! EW - Extended wait (EW) uses the EMCStaticExtendedWait register to time both the read and write
3441 * transfers rather than the EMCStaticWaitRd and EMCStaticWaitWr registers.
3442 */
3443#define EMC_STATIC_STATICCONFIG_EW(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATIC_STATICCONFIG_EW_SHIFT)) & EMC_STATIC_STATICCONFIG_EW_MASK)
3444#define EMC_STATIC_STATICCONFIG_B_MASK (0x80000U)
3445#define EMC_STATIC_STATICCONFIG_B_SHIFT (19U)
3446/*! B - Buffer enable [2].
3447 */
3448#define EMC_STATIC_STATICCONFIG_B(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATIC_STATICCONFIG_B_SHIFT)) & EMC_STATIC_STATICCONFIG_B_MASK)
3449#define EMC_STATIC_STATICCONFIG_P_MASK (0x100000U)
3450#define EMC_STATIC_STATICCONFIG_P_SHIFT (20U)
3451/*! P - Write protect.
3452 */
3453#define EMC_STATIC_STATICCONFIG_P(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATIC_STATICCONFIG_P_SHIFT)) & EMC_STATIC_STATICCONFIG_P_MASK)
3454/*! @} */
3455
3456/* The count of EMC_STATIC_STATICCONFIG */
3457#define EMC_STATIC_STATICCONFIG_COUNT (4U)
3458
3459/*! @name STATIC_STATICWAITWEN - Delay from EMC_CSx to write enable */
3460/*! @{ */
3461#define EMC_STATIC_STATICWAITWEN_WAITWEN_MASK (0xFU)
3462#define EMC_STATIC_STATICWAITWEN_WAITWEN_SHIFT (0U)
3463/*! WAITWEN - Wait write enable.
3464 */
3465#define EMC_STATIC_STATICWAITWEN_WAITWEN(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATIC_STATICWAITWEN_WAITWEN_SHIFT)) & EMC_STATIC_STATICWAITWEN_WAITWEN_MASK)
3466/*! @} */
3467
3468/* The count of EMC_STATIC_STATICWAITWEN */
3469#define EMC_STATIC_STATICWAITWEN_COUNT (4U)
3470
3471/*! @name STATIC_STATICWAITOEN - Delay from EMC_CSx or address change, whichever is later, to output enable */
3472/*! @{ */
3473#define EMC_STATIC_STATICWAITOEN_WAITOEN_MASK (0xFU)
3474#define EMC_STATIC_STATICWAITOEN_WAITOEN_SHIFT (0U)
3475/*! WAITOEN - Wait output enable.
3476 */
3477#define EMC_STATIC_STATICWAITOEN_WAITOEN(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATIC_STATICWAITOEN_WAITOEN_SHIFT)) & EMC_STATIC_STATICWAITOEN_WAITOEN_MASK)
3478/*! @} */
3479
3480/* The count of EMC_STATIC_STATICWAITOEN */
3481#define EMC_STATIC_STATICWAITOEN_COUNT (4U)
3482
3483/*! @name STATIC_STATICWAITRD - Delay from EMC_CSx to a read access */
3484/*! @{ */
3485#define EMC_STATIC_STATICWAITRD_WAITRD_MASK (0x1FU)
3486#define EMC_STATIC_STATICWAITRD_WAITRD_SHIFT (0U)
3487/*! WAITRD - .
3488 */
3489#define EMC_STATIC_STATICWAITRD_WAITRD(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATIC_STATICWAITRD_WAITRD_SHIFT)) & EMC_STATIC_STATICWAITRD_WAITRD_MASK)
3490/*! @} */
3491
3492/* The count of EMC_STATIC_STATICWAITRD */
3493#define EMC_STATIC_STATICWAITRD_COUNT (4U)
3494
3495/*! @name STATIC_STATICWAITPAGE - Delay for asynchronous page mode sequential accesses for EMC_CSx */
3496/*! @{ */
3497#define EMC_STATIC_STATICWAITPAGE_WAITPAGE_MASK (0x1FU)
3498#define EMC_STATIC_STATICWAITPAGE_WAITPAGE_SHIFT (0U)
3499/*! WAITPAGE - Asynchronous page mode read after the first read wait states.
3500 */
3501#define EMC_STATIC_STATICWAITPAGE_WAITPAGE(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATIC_STATICWAITPAGE_WAITPAGE_SHIFT)) & EMC_STATIC_STATICWAITPAGE_WAITPAGE_MASK)
3502/*! @} */
3503
3504/* The count of EMC_STATIC_STATICWAITPAGE */
3505#define EMC_STATIC_STATICWAITPAGE_COUNT (4U)
3506
3507/*! @name STATIC_STATICWAITWR - Delay from EMC_CSx to a write access */
3508/*! @{ */
3509#define EMC_STATIC_STATICWAITWR_WAITWR_MASK (0x1FU)
3510#define EMC_STATIC_STATICWAITWR_WAITWR_SHIFT (0U)
3511/*! WAITWR - Write wait states.
3512 */
3513#define EMC_STATIC_STATICWAITWR_WAITWR(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATIC_STATICWAITWR_WAITWR_SHIFT)) & EMC_STATIC_STATICWAITWR_WAITWR_MASK)
3514/*! @} */
3515
3516/* The count of EMC_STATIC_STATICWAITWR */
3517#define EMC_STATIC_STATICWAITWR_COUNT (4U)
3518
3519/*! @name STATIC_STATICWAITTURN - Number of bus turnaround cycles EMC_CSx */
3520/*! @{ */
3521#define EMC_STATIC_STATICWAITTURN_WAITTURN_MASK (0xFU)
3522#define EMC_STATIC_STATICWAITTURN_WAITTURN_SHIFT (0U)
3523/*! WAITTURN - Bus turn-around cycles.
3524 */
3525#define EMC_STATIC_STATICWAITTURN_WAITTURN(x) (((uint32_t)(((uint32_t)(x)) << EMC_STATIC_STATICWAITTURN_WAITTURN_SHIFT)) & EMC_STATIC_STATICWAITTURN_WAITTURN_MASK)
3526/*! @} */
3527
3528/* The count of EMC_STATIC_STATICWAITTURN */
3529#define EMC_STATIC_STATICWAITTURN_COUNT (4U)
3530
3531
3532/*!
3533 * @}
3534 */ /* end of group EMC_Register_Masks */
3535
3536
3537/* EMC - Peripheral instance base addresses */
3538/** Peripheral EMC base address */
3539#define EMC_BASE (0x40081000u)
3540/** Peripheral EMC base pointer */
3541#define EMC ((EMC_Type *)EMC_BASE)
3542/** Array initializer of EMC peripheral base addresses */
3543#define EMC_BASE_ADDRS { EMC_BASE }
3544/** Array initializer of EMC peripheral base pointers */
3545#define EMC_BASE_PTRS { EMC }
3546
3547/*!
3548 * @}
3549 */ /* end of group EMC_Peripheral_Access_Layer */
3550
3551
3552/* ----------------------------------------------------------------------------
3553 -- FLEXCOMM Peripheral Access Layer
3554 ---------------------------------------------------------------------------- */
3555
3556/*!
3557 * @addtogroup FLEXCOMM_Peripheral_Access_Layer FLEXCOMM Peripheral Access Layer
3558 * @{
3559 */
3560
3561/** FLEXCOMM - Register Layout Typedef */
3562typedef struct {
3563 uint8_t RESERVED_0[4088];
3564 __IO uint32_t PSELID; /**< Peripheral Select and Flexcomm ID register., offset: 0xFF8 */
3565 __I uint32_t PID; /**< Peripheral identification register., offset: 0xFFC */
3566} FLEXCOMM_Type;
3567
3568/* ----------------------------------------------------------------------------
3569 -- FLEXCOMM Register Masks
3570 ---------------------------------------------------------------------------- */
3571
3572/*!
3573 * @addtogroup FLEXCOMM_Register_Masks FLEXCOMM Register Masks
3574 * @{
3575 */
3576
3577/*! @name PSELID - Peripheral Select and Flexcomm ID register. */
3578/*! @{ */
3579#define FLEXCOMM_PSELID_PERSEL_MASK (0x7U)
3580#define FLEXCOMM_PSELID_PERSEL_SHIFT (0U)
3581/*! PERSEL - Peripheral Select. This field is writable by software.
3582 * 0b000..No peripheral selected.
3583 * 0b001..USART function selected.
3584 * 0b010..SPI function selected.
3585 * 0b011..I2C function selected.
3586 * 0b100..I2S transmit function selected.
3587 * 0b101..I2S receive function selected.
3588 * 0b110..Reserved
3589 * 0b111..Reserved
3590 */
3591#define FLEXCOMM_PSELID_PERSEL(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_PERSEL_SHIFT)) & FLEXCOMM_PSELID_PERSEL_MASK)
3592#define FLEXCOMM_PSELID_LOCK_MASK (0x8U)
3593#define FLEXCOMM_PSELID_LOCK_SHIFT (3U)
3594/*! LOCK - Lock the peripheral select. This field is writable by software.
3595 * 0b0..Peripheral select can be changed by software.
3596 * 0b1..Peripheral select is locked and cannot be changed until this Flexcomm or the entire device is reset.
3597 */
3598#define FLEXCOMM_PSELID_LOCK(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_LOCK_SHIFT)) & FLEXCOMM_PSELID_LOCK_MASK)
3599#define FLEXCOMM_PSELID_USARTPRESENT_MASK (0x10U)
3600#define FLEXCOMM_PSELID_USARTPRESENT_SHIFT (4U)
3601/*! USARTPRESENT - USART present indicator. This field is Read-only.
3602 * 0b0..This Flexcomm does not include the USART function.
3603 * 0b1..This Flexcomm includes the USART function.
3604 */
3605#define FLEXCOMM_PSELID_USARTPRESENT(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_USARTPRESENT_SHIFT)) & FLEXCOMM_PSELID_USARTPRESENT_MASK)
3606#define FLEXCOMM_PSELID_SPIPRESENT_MASK (0x20U)
3607#define FLEXCOMM_PSELID_SPIPRESENT_SHIFT (5U)
3608/*! SPIPRESENT - SPI present indicator. This field is Read-only.
3609 * 0b0..This Flexcomm does not include the SPI function.
3610 * 0b1..This Flexcomm includes the SPI function.
3611 */
3612#define FLEXCOMM_PSELID_SPIPRESENT(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_SPIPRESENT_SHIFT)) & FLEXCOMM_PSELID_SPIPRESENT_MASK)
3613#define FLEXCOMM_PSELID_I2CPRESENT_MASK (0x40U)
3614#define FLEXCOMM_PSELID_I2CPRESENT_SHIFT (6U)
3615/*! I2CPRESENT - I2C present indicator. This field is Read-only.
3616 * 0b0..This Flexcomm does not include the I2C function.
3617 * 0b1..This Flexcomm includes the I2C function.
3618 */
3619#define FLEXCOMM_PSELID_I2CPRESENT(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_I2CPRESENT_SHIFT)) & FLEXCOMM_PSELID_I2CPRESENT_MASK)
3620#define FLEXCOMM_PSELID_I2SPRESENT_MASK (0x80U)
3621#define FLEXCOMM_PSELID_I2SPRESENT_SHIFT (7U)
3622/*! I2SPRESENT - I 2S present indicator. This field is Read-only.
3623 * 0b0..This Flexcomm does not include the I2S function.
3624 * 0b1..This Flexcomm includes the I2S function.
3625 */
3626#define FLEXCOMM_PSELID_I2SPRESENT(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_I2SPRESENT_SHIFT)) & FLEXCOMM_PSELID_I2SPRESENT_MASK)
3627#define FLEXCOMM_PSELID_ID_MASK (0xFFFFF000U)
3628#define FLEXCOMM_PSELID_ID_SHIFT (12U)
3629/*! ID - Flexcomm ID.
3630 */
3631#define FLEXCOMM_PSELID_ID(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PSELID_ID_SHIFT)) & FLEXCOMM_PSELID_ID_MASK)
3632/*! @} */
3633
3634/*! @name PID - Peripheral identification register. */
3635/*! @{ */
3636#define FLEXCOMM_PID_Minor_Rev_MASK (0xF00U)
3637#define FLEXCOMM_PID_Minor_Rev_SHIFT (8U)
3638/*! Minor_Rev - Minor revision of module implementation.
3639 */
3640#define FLEXCOMM_PID_Minor_Rev(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PID_Minor_Rev_SHIFT)) & FLEXCOMM_PID_Minor_Rev_MASK)
3641#define FLEXCOMM_PID_Major_Rev_MASK (0xF000U)
3642#define FLEXCOMM_PID_Major_Rev_SHIFT (12U)
3643/*! Major_Rev - Major revision of module implementation.
3644 */
3645#define FLEXCOMM_PID_Major_Rev(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PID_Major_Rev_SHIFT)) & FLEXCOMM_PID_Major_Rev_MASK)
3646#define FLEXCOMM_PID_ID_MASK (0xFFFF0000U)
3647#define FLEXCOMM_PID_ID_SHIFT (16U)
3648/*! ID - Module identifier for the selected function.
3649 */
3650#define FLEXCOMM_PID_ID(x) (((uint32_t)(((uint32_t)(x)) << FLEXCOMM_PID_ID_SHIFT)) & FLEXCOMM_PID_ID_MASK)
3651/*! @} */
3652
3653
3654/*!
3655 * @}
3656 */ /* end of group FLEXCOMM_Register_Masks */
3657
3658
3659/* FLEXCOMM - Peripheral instance base addresses */
3660/** Peripheral FLEXCOMM0 base address */
3661#define FLEXCOMM0_BASE (0x40086000u)
3662/** Peripheral FLEXCOMM0 base pointer */
3663#define FLEXCOMM0 ((FLEXCOMM_Type *)FLEXCOMM0_BASE)
3664/** Peripheral FLEXCOMM1 base address */
3665#define FLEXCOMM1_BASE (0x40087000u)
3666/** Peripheral FLEXCOMM1 base pointer */
3667#define FLEXCOMM1 ((FLEXCOMM_Type *)FLEXCOMM1_BASE)
3668/** Peripheral FLEXCOMM2 base address */
3669#define FLEXCOMM2_BASE (0x40088000u)
3670/** Peripheral FLEXCOMM2 base pointer */
3671#define FLEXCOMM2 ((FLEXCOMM_Type *)FLEXCOMM2_BASE)
3672/** Peripheral FLEXCOMM3 base address */
3673#define FLEXCOMM3_BASE (0x40089000u)
3674/** Peripheral FLEXCOMM3 base pointer */
3675#define FLEXCOMM3 ((FLEXCOMM_Type *)FLEXCOMM3_BASE)
3676/** Peripheral FLEXCOMM4 base address */
3677#define FLEXCOMM4_BASE (0x4008A000u)
3678/** Peripheral FLEXCOMM4 base pointer */
3679#define FLEXCOMM4 ((FLEXCOMM_Type *)FLEXCOMM4_BASE)
3680/** Peripheral FLEXCOMM5 base address */
3681#define FLEXCOMM5_BASE (0x40096000u)
3682/** Peripheral FLEXCOMM5 base pointer */
3683#define FLEXCOMM5 ((FLEXCOMM_Type *)FLEXCOMM5_BASE)
3684/** Peripheral FLEXCOMM6 base address */
3685#define FLEXCOMM6_BASE (0x40097000u)
3686/** Peripheral FLEXCOMM6 base pointer */
3687#define FLEXCOMM6 ((FLEXCOMM_Type *)FLEXCOMM6_BASE)
3688/** Peripheral FLEXCOMM7 base address */
3689#define FLEXCOMM7_BASE (0x40098000u)
3690/** Peripheral FLEXCOMM7 base pointer */
3691#define FLEXCOMM7 ((FLEXCOMM_Type *)FLEXCOMM7_BASE)
3692/** Peripheral FLEXCOMM8 base address */
3693#define FLEXCOMM8_BASE (0x40099000u)
3694/** Peripheral FLEXCOMM8 base pointer */
3695#define FLEXCOMM8 ((FLEXCOMM_Type *)FLEXCOMM8_BASE)
3696/** Peripheral FLEXCOMM9 base address */
3697#define FLEXCOMM9_BASE (0x4009A000u)
3698/** Peripheral FLEXCOMM9 base pointer */
3699#define FLEXCOMM9 ((FLEXCOMM_Type *)FLEXCOMM9_BASE)
3700/** Peripheral FLEXCOMM10 base address */
3701#define FLEXCOMM10_BASE (0x4009F000u)
3702/** Peripheral FLEXCOMM10 base pointer */
3703#define FLEXCOMM10 ((FLEXCOMM_Type *)FLEXCOMM10_BASE)
3704/** Array initializer of FLEXCOMM peripheral base addresses */
3705#define FLEXCOMM_BASE_ADDRS { FLEXCOMM0_BASE, FLEXCOMM1_BASE, FLEXCOMM2_BASE, FLEXCOMM3_BASE, FLEXCOMM4_BASE, FLEXCOMM5_BASE, FLEXCOMM6_BASE, FLEXCOMM7_BASE, FLEXCOMM8_BASE, FLEXCOMM9_BASE, FLEXCOMM10_BASE }
3706/** Array initializer of FLEXCOMM peripheral base pointers */
3707#define FLEXCOMM_BASE_PTRS { FLEXCOMM0, FLEXCOMM1, FLEXCOMM2, FLEXCOMM3, FLEXCOMM4, FLEXCOMM5, FLEXCOMM6, FLEXCOMM7, FLEXCOMM8, FLEXCOMM9, FLEXCOMM10 }
3708/** Interrupt vectors for the FLEXCOMM peripheral type */
3709#define FLEXCOMM_IRQS { FLEXCOMM0_IRQn, FLEXCOMM1_IRQn, FLEXCOMM2_IRQn, FLEXCOMM3_IRQn, FLEXCOMM4_IRQn, FLEXCOMM5_IRQn, FLEXCOMM6_IRQn, FLEXCOMM7_IRQn, FLEXCOMM8_IRQn, FLEXCOMM9_IRQn, FLEXCOMM10_IRQn }
3710
3711/*!
3712 * @}
3713 */ /* end of group FLEXCOMM_Peripheral_Access_Layer */
3714
3715
3716/* ----------------------------------------------------------------------------
3717 -- GINT Peripheral Access Layer
3718 ---------------------------------------------------------------------------- */
3719
3720/*!
3721 * @addtogroup GINT_Peripheral_Access_Layer GINT Peripheral Access Layer
3722 * @{
3723 */
3724
3725/** GINT - Register Layout Typedef */
3726typedef struct {
3727 __IO uint32_t CTRL; /**< GPIO grouped interrupt control register, offset: 0x0 */
3728 uint8_t RESERVED_0[28];
3729 __IO uint32_t PORT_POL[2]; /**< GPIO grouped interrupt port 0 polarity register, array offset: 0x20, array step: 0x4 */
3730 uint8_t RESERVED_1[24];
3731 __IO uint32_t PORT_ENA[2]; /**< GPIO grouped interrupt port 0 enable register, array offset: 0x40, array step: 0x4 */
3732} GINT_Type;
3733
3734/* ----------------------------------------------------------------------------
3735 -- GINT Register Masks
3736 ---------------------------------------------------------------------------- */
3737
3738/*!
3739 * @addtogroup GINT_Register_Masks GINT Register Masks
3740 * @{
3741 */
3742
3743/*! @name CTRL - GPIO grouped interrupt control register */
3744/*! @{ */
3745#define GINT_CTRL_INT_MASK (0x1U)
3746#define GINT_CTRL_INT_SHIFT (0U)
3747/*! INT - Group interrupt status. This bit is cleared by writing a one to it. Writing zero has no effect.
3748 * 0b0..No request. No interrupt request is pending.
3749 * 0b1..Request active. Interrupt request is active.
3750 */
3751#define GINT_CTRL_INT(x) (((uint32_t)(((uint32_t)(x)) << GINT_CTRL_INT_SHIFT)) & GINT_CTRL_INT_MASK)
3752#define GINT_CTRL_COMB_MASK (0x2U)
3753#define GINT_CTRL_COMB_SHIFT (1U)
3754/*! COMB - Combine enabled inputs for group interrupt
3755 * 0b0..Or. OR functionality: A grouped interrupt is generated when any one of the enabled inputs is active (based on its programmed polarity).
3756 * 0b1..And. AND functionality: An interrupt is generated when all enabled bits are active (based on their programmed polarity).
3757 */
3758#define GINT_CTRL_COMB(x) (((uint32_t)(((uint32_t)(x)) << GINT_CTRL_COMB_SHIFT)) & GINT_CTRL_COMB_MASK)
3759#define GINT_CTRL_TRIG_MASK (0x4U)
3760#define GINT_CTRL_TRIG_SHIFT (2U)
3761/*! TRIG - Group interrupt trigger
3762 * 0b0..Edge-triggered.
3763 * 0b1..Level-triggered.
3764 */
3765#define GINT_CTRL_TRIG(x) (((uint32_t)(((uint32_t)(x)) << GINT_CTRL_TRIG_SHIFT)) & GINT_CTRL_TRIG_MASK)
3766/*! @} */
3767
3768/*! @name PORT_POL - GPIO grouped interrupt port 0 polarity register */
3769/*! @{ */
3770#define GINT_PORT_POL_POL_MASK (0xFFFFFFFFU)
3771#define GINT_PORT_POL_POL_SHIFT (0U)
3772/*! POL - Configure pin polarity of port m pins for group interrupt. Bit n corresponds to pin PIOm_n
3773 * of port m. 0 = the pin is active LOW. If the level on this pin is LOW, the pin contributes to
3774 * the group interrupt. 1 = the pin is active HIGH. If the level on this pin is HIGH, the pin
3775 * contributes to the group interrupt.
3776 */
3777#define GINT_PORT_POL_POL(x) (((uint32_t)(((uint32_t)(x)) << GINT_PORT_POL_POL_SHIFT)) & GINT_PORT_POL_POL_MASK)
3778/*! @} */
3779
3780/* The count of GINT_PORT_POL */
3781#define GINT_PORT_POL_COUNT (2U)
3782
3783/*! @name PORT_ENA - GPIO grouped interrupt port 0 enable register */
3784/*! @{ */
3785#define GINT_PORT_ENA_ENA_MASK (0xFFFFFFFFU)
3786#define GINT_PORT_ENA_ENA_SHIFT (0U)
3787/*! ENA - Enable port 0 pin for group interrupt. Bit n corresponds to pin Pm_n of port m. 0 = the
3788 * port 0 pin is disabled and does not contribute to the grouped interrupt. 1 = the port 0 pin is
3789 * enabled and contributes to the grouped interrupt.
3790 */
3791#define GINT_PORT_ENA_ENA(x) (((uint32_t)(((uint32_t)(x)) << GINT_PORT_ENA_ENA_SHIFT)) & GINT_PORT_ENA_ENA_MASK)
3792/*! @} */
3793
3794/* The count of GINT_PORT_ENA */
3795#define GINT_PORT_ENA_COUNT (2U)
3796
3797
3798/*!
3799 * @}
3800 */ /* end of group GINT_Register_Masks */
3801
3802
3803/* GINT - Peripheral instance base addresses */
3804/** Peripheral GINT0 base address */
3805#define GINT0_BASE (0x40002000u)
3806/** Peripheral GINT0 base pointer */
3807#define GINT0 ((GINT_Type *)GINT0_BASE)
3808/** Peripheral GINT1 base address */
3809#define GINT1_BASE (0x40003000u)
3810/** Peripheral GINT1 base pointer */
3811#define GINT1 ((GINT_Type *)GINT1_BASE)
3812/** Array initializer of GINT peripheral base addresses */
3813#define GINT_BASE_ADDRS { GINT0_BASE, GINT1_BASE }
3814/** Array initializer of GINT peripheral base pointers */
3815#define GINT_BASE_PTRS { GINT0, GINT1 }
3816/** Interrupt vectors for the GINT peripheral type */
3817#define GINT_IRQS { GINT0_IRQn, GINT1_IRQn }
3818
3819/*!
3820 * @}
3821 */ /* end of group GINT_Peripheral_Access_Layer */
3822
3823
3824/* ----------------------------------------------------------------------------
3825 -- GPIO Peripheral Access Layer
3826 ---------------------------------------------------------------------------- */
3827
3828/*!
3829 * @addtogroup GPIO_Peripheral_Access_Layer GPIO Peripheral Access Layer
3830 * @{
3831 */
3832
3833/** GPIO - Register Layout Typedef */
3834typedef struct {
3835 __IO uint8_t B[6][32]; /**< Byte pin registers for all port 0 and 1 GPIO pins, array offset: 0x0, array step: index*0x20, index2*0x1 */
3836 uint8_t RESERVED_0[3904];
3837 __IO uint32_t W[6][32]; /**< Word pin registers for all port 0 and 1 GPIO pins, array offset: 0x1000, array step: index*0x80, index2*0x4 */
3838 uint8_t RESERVED_1[3328];
3839 __IO uint32_t DIR[6]; /**< Direction registers, array offset: 0x2000, array step: 0x4 */
3840 uint8_t RESERVED_2[104];
3841 __IO uint32_t MASK[6]; /**< Mask register, array offset: 0x2080, array step: 0x4 */
3842 uint8_t RESERVED_3[104];
3843 __IO uint32_t PIN[6]; /**< Port pin register, array offset: 0x2100, array step: 0x4 */
3844 uint8_t RESERVED_4[104];
3845 __IO uint32_t MPIN[6]; /**< Masked port register, array offset: 0x2180, array step: 0x4 */
3846 uint8_t RESERVED_5[104];
3847 __IO uint32_t SET[6]; /**< Write: Set register for port Read: output bits for port, array offset: 0x2200, array step: 0x4 */
3848 uint8_t RESERVED_6[104];
3849 __O uint32_t CLR[6]; /**< Clear port, array offset: 0x2280, array step: 0x4 */
3850 uint8_t RESERVED_7[104];
3851 __O uint32_t NOT[6]; /**< Toggle port, array offset: 0x2300, array step: 0x4 */
3852 uint8_t RESERVED_8[104];
3853 __O uint32_t DIRSET[6]; /**< Set pin direction bits for port, array offset: 0x2380, array step: 0x4 */
3854 uint8_t RESERVED_9[104];
3855 __O uint32_t DIRCLR[6]; /**< Clear pin direction bits for port, array offset: 0x2400, array step: 0x4 */
3856 uint8_t RESERVED_10[104];
3857 __O uint32_t DIRNOT[6]; /**< Toggle pin direction bits for port, array offset: 0x2480, array step: 0x4 */
3858} GPIO_Type;
3859
3860/* ----------------------------------------------------------------------------
3861 -- GPIO Register Masks
3862 ---------------------------------------------------------------------------- */
3863
3864/*!
3865 * @addtogroup GPIO_Register_Masks GPIO Register Masks
3866 * @{
3867 */
3868
3869/*! @name B - Byte pin registers for all port 0 and 1 GPIO pins */
3870/*! @{ */
3871#define GPIO_B_PBYTE_MASK (0x1U)
3872#define GPIO_B_PBYTE_SHIFT (0U)
3873/*! PBYTE - Read: state of the pin PIOm_n, regardless of direction, masking, or alternate function,
3874 * except that pins configured as analog I/O always read as 0. One register for each port pin.
3875 * Supported pins depends on the specific device and package. Write: loads the pin's output bit.
3876 * One register for each port pin. Supported pins depends on the specific device and package.
3877 */
3878#define GPIO_B_PBYTE(x) (((uint8_t)(((uint8_t)(x)) << GPIO_B_PBYTE_SHIFT)) & GPIO_B_PBYTE_MASK)
3879/*! @} */
3880
3881/* The count of GPIO_B */
3882#define GPIO_B_COUNT (6U)
3883
3884/* The count of GPIO_B */
3885#define GPIO_B_COUNT2 (32U)
3886
3887/*! @name W - Word pin registers for all port 0 and 1 GPIO pins */
3888/*! @{ */
3889#define GPIO_W_PWORD_MASK (0xFFFFFFFFU)
3890#define GPIO_W_PWORD_SHIFT (0U)
3891/*! PWORD - Read 0: pin PIOm_n is LOW. Write 0: clear output bit. Read 0xFFFF FFFF: pin PIOm_n is
3892 * HIGH. Write any value 0x0000 0001 to 0xFFFF FFFF: set output bit. Only 0 or 0xFFFF FFFF can be
3893 * read. Writing any value other than 0 will set the output bit. One register for each port pin.
3894 * Supported pins depends on the specific device and package.
3895 */
3896#define GPIO_W_PWORD(x) (((uint32_t)(((uint32_t)(x)) << GPIO_W_PWORD_SHIFT)) & GPIO_W_PWORD_MASK)
3897/*! @} */
3898
3899/* The count of GPIO_W */
3900#define GPIO_W_COUNT (6U)
3901
3902/* The count of GPIO_W */
3903#define GPIO_W_COUNT2 (32U)
3904
3905/*! @name DIR - Direction registers */
3906/*! @{ */
3907#define GPIO_DIR_DIRP_MASK (0xFFFFFFFFU)
3908#define GPIO_DIR_DIRP_SHIFT (0U)
3909/*! DIRP - Selects pin direction for pin PIOm_n (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported
3910 * pins depends on the specific device and package. 0 = input. 1 = output.
3911 */
3912#define GPIO_DIR_DIRP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_DIR_DIRP_SHIFT)) & GPIO_DIR_DIRP_MASK)
3913/*! @} */
3914
3915/* The count of GPIO_DIR */
3916#define GPIO_DIR_COUNT (6U)
3917
3918/*! @name MASK - Mask register */
3919/*! @{ */
3920#define GPIO_MASK_MASKP_MASK (0xFFFFFFFFU)
3921#define GPIO_MASK_MASKP_SHIFT (0U)
3922/*! MASKP - Controls which bits corresponding to PIOm_n are active in the MPORT register (bit 0 =
3923 * PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on the specific device and package. 0 =
3924 * Read MPORT: pin state; write MPORT: load output bit. 1 = Read MPORT: 0; write MPORT: output bit
3925 * not affected.
3926 */
3927#define GPIO_MASK_MASKP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_MASK_MASKP_SHIFT)) & GPIO_MASK_MASKP_MASK)
3928/*! @} */
3929
3930/* The count of GPIO_MASK */
3931#define GPIO_MASK_COUNT (6U)
3932
3933/*! @name PIN - Port pin register */
3934/*! @{ */
3935#define GPIO_PIN_PORT_MASK (0xFFFFFFFFU)
3936#define GPIO_PIN_PORT_SHIFT (0U)
3937/*! PORT - Reads pin states or loads output bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported
3938 * pins depends on the specific device and package. 0 = Read: pin is low; write: clear output bit.
3939 * 1 = Read: pin is high; write: set output bit.
3940 */
3941#define GPIO_PIN_PORT(x) (((uint32_t)(((uint32_t)(x)) << GPIO_PIN_PORT_SHIFT)) & GPIO_PIN_PORT_MASK)
3942/*! @} */
3943
3944/* The count of GPIO_PIN */
3945#define GPIO_PIN_COUNT (6U)
3946
3947/*! @name MPIN - Masked port register */
3948/*! @{ */
3949#define GPIO_MPIN_MPORTP_MASK (0xFFFFFFFFU)
3950#define GPIO_MPIN_MPORTP_SHIFT (0U)
3951/*! MPORTP - Masked port register (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on
3952 * the specific device and package. 0 = Read: pin is LOW and/or the corresponding bit in the MASK
3953 * register is 1; write: clear output bit if the corresponding bit in the MASK register is 0. 1
3954 * = Read: pin is HIGH and the corresponding bit in the MASK register is 0; write: set output bit
3955 * if the corresponding bit in the MASK register is 0.
3956 */
3957#define GPIO_MPIN_MPORTP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_MPIN_MPORTP_SHIFT)) & GPIO_MPIN_MPORTP_MASK)
3958/*! @} */
3959
3960/* The count of GPIO_MPIN */
3961#define GPIO_MPIN_COUNT (6U)
3962
3963/*! @name SET - Write: Set register for port Read: output bits for port */
3964/*! @{ */
3965#define GPIO_SET_SETP_MASK (0xFFFFFFFFU)
3966#define GPIO_SET_SETP_SHIFT (0U)
3967/*! SETP - Read or set output bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on
3968 * the specific device and package. 0 = Read: output bit: write: no operation. 1 = Read: output
3969 * bit; write: set output bit.
3970 */
3971#define GPIO_SET_SETP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_SET_SETP_SHIFT)) & GPIO_SET_SETP_MASK)
3972/*! @} */
3973
3974/* The count of GPIO_SET */
3975#define GPIO_SET_COUNT (6U)
3976
3977/*! @name CLR - Clear port */
3978/*! @{ */
3979#define GPIO_CLR_CLRP_MASK (0xFFFFFFFFU)
3980#define GPIO_CLR_CLRP_SHIFT (0U)
3981/*! CLRP - Clear output bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on the
3982 * specific device and package. 0 = No operation. 1 = Clear output bit.
3983 */
3984#define GPIO_CLR_CLRP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_CLR_CLRP_SHIFT)) & GPIO_CLR_CLRP_MASK)
3985/*! @} */
3986
3987/* The count of GPIO_CLR */
3988#define GPIO_CLR_COUNT (6U)
3989
3990/*! @name NOT - Toggle port */
3991/*! @{ */
3992#define GPIO_NOT_NOTP_MASK (0xFFFFFFFFU)
3993#define GPIO_NOT_NOTP_SHIFT (0U)
3994/*! NOTP - Toggle output bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on the
3995 * specific device and package. 0 = no operation. 1 = Toggle output bit.
3996 */
3997#define GPIO_NOT_NOTP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_NOT_NOTP_SHIFT)) & GPIO_NOT_NOTP_MASK)
3998/*! @} */
3999
4000/* The count of GPIO_NOT */
4001#define GPIO_NOT_COUNT (6U)
4002
4003/*! @name DIRSET - Set pin direction bits for port */
4004/*! @{ */
4005#define GPIO_DIRSET_DIRSETP_MASK (0x1FFFFFFFU)
4006#define GPIO_DIRSET_DIRSETP_SHIFT (0U)
4007/*! DIRSETP - Set direction bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on
4008 * the specific device and package. 0 = No operation. 1 = Set direction bit.
4009 */
4010#define GPIO_DIRSET_DIRSETP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_DIRSET_DIRSETP_SHIFT)) & GPIO_DIRSET_DIRSETP_MASK)
4011/*! @} */
4012
4013/* The count of GPIO_DIRSET */
4014#define GPIO_DIRSET_COUNT (6U)
4015
4016/*! @name DIRCLR - Clear pin direction bits for port */
4017/*! @{ */
4018#define GPIO_DIRCLR_DIRCLRP_MASK (0x1FFFFFFFU)
4019#define GPIO_DIRCLR_DIRCLRP_SHIFT (0U)
4020/*! DIRCLRP - Clear direction bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends on
4021 * the specific device and package. 0 = No operation. 1 = Clear direction bit.
4022 */
4023#define GPIO_DIRCLR_DIRCLRP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_DIRCLR_DIRCLRP_SHIFT)) & GPIO_DIRCLR_DIRCLRP_MASK)
4024/*! @} */
4025
4026/* The count of GPIO_DIRCLR */
4027#define GPIO_DIRCLR_COUNT (6U)
4028
4029/*! @name DIRNOT - Toggle pin direction bits for port */
4030/*! @{ */
4031#define GPIO_DIRNOT_DIRNOTP_MASK (0x1FFFFFFFU)
4032#define GPIO_DIRNOT_DIRNOTP_SHIFT (0U)
4033/*! DIRNOTP - Toggle direction bits (bit 0 = PIOn_0, bit 1 = PIOn_1, etc.). Supported pins depends
4034 * on the specific device and package. 0 = no operation. 1 = Toggle direction bit.
4035 */
4036#define GPIO_DIRNOT_DIRNOTP(x) (((uint32_t)(((uint32_t)(x)) << GPIO_DIRNOT_DIRNOTP_SHIFT)) & GPIO_DIRNOT_DIRNOTP_MASK)
4037/*! @} */
4038
4039/* The count of GPIO_DIRNOT */
4040#define GPIO_DIRNOT_COUNT (6U)
4041
4042
4043/*!
4044 * @}
4045 */ /* end of group GPIO_Register_Masks */
4046
4047
4048/* GPIO - Peripheral instance base addresses */
4049/** Peripheral GPIO base address */
4050#define GPIO_BASE (0x4008C000u)
4051/** Peripheral GPIO base pointer */
4052#define GPIO ((GPIO_Type *)GPIO_BASE)
4053/** Array initializer of GPIO peripheral base addresses */
4054#define GPIO_BASE_ADDRS { GPIO_BASE }
4055/** Array initializer of GPIO peripheral base pointers */
4056#define GPIO_BASE_PTRS { GPIO }
4057
4058/*!
4059 * @}
4060 */ /* end of group GPIO_Peripheral_Access_Layer */
4061
4062
4063/* ----------------------------------------------------------------------------
4064 -- I2C Peripheral Access Layer
4065 ---------------------------------------------------------------------------- */
4066
4067/*!
4068 * @addtogroup I2C_Peripheral_Access_Layer I2C Peripheral Access Layer
4069 * @{
4070 */
4071
4072/** I2C - Register Layout Typedef */
4073typedef struct {
4074 uint8_t RESERVED_0[2048];
4075 __IO uint32_t CFG; /**< Configuration for shared functions., offset: 0x800 */
4076 __IO uint32_t STAT; /**< Status register for Master, Slave, and Monitor functions., offset: 0x804 */
4077 __IO uint32_t INTENSET; /**< Interrupt Enable Set and read register., offset: 0x808 */
4078 __O uint32_t INTENCLR; /**< Interrupt Enable Clear register., offset: 0x80C */
4079 __IO uint32_t TIMEOUT; /**< Time-out value register., offset: 0x810 */
4080 __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 */
4081 __I uint32_t INTSTAT; /**< Interrupt Status register for Master, Slave, and Monitor functions., offset: 0x818 */
4082 uint8_t RESERVED_1[4];
4083 __IO uint32_t MSTCTL; /**< Master control register., offset: 0x820 */
4084 __IO uint32_t MSTTIME; /**< Master timing configuration., offset: 0x824 */
4085 __IO uint32_t MSTDAT; /**< Combined Master receiver and transmitter data register., offset: 0x828 */
4086 uint8_t RESERVED_2[20];
4087 __IO uint32_t SLVCTL; /**< Slave control register., offset: 0x840 */
4088 __IO uint32_t SLVDAT; /**< Combined Slave receiver and transmitter data register., offset: 0x844 */
4089 __IO uint32_t SLVADR[4]; /**< Slave address register., array offset: 0x848, array step: 0x4 */
4090 __IO uint32_t SLVQUAL0; /**< Slave Qualification for address 0., offset: 0x858 */
4091 uint8_t RESERVED_3[36];
4092 __I uint32_t MONRXDAT; /**< Monitor receiver data register., offset: 0x880 */
4093 uint8_t RESERVED_4[1912];
4094 __I uint32_t ID; /**< Peripheral identification register., offset: 0xFFC */
4095} I2C_Type;
4096
4097/* ----------------------------------------------------------------------------
4098 -- I2C Register Masks
4099 ---------------------------------------------------------------------------- */
4100
4101/*!
4102 * @addtogroup I2C_Register_Masks I2C Register Masks
4103 * @{
4104 */
4105
4106/*! @name CFG - Configuration for shared functions. */
4107/*! @{ */
4108#define I2C_CFG_MSTEN_MASK (0x1U)
4109#define I2C_CFG_MSTEN_SHIFT (0U)
4110/*! MSTEN - Master Enable. When disabled, configurations settings for the Master function are not
4111 * changed, but the Master function is internally reset.
4112 * 0b0..Disabled. The I2C Master function is disabled.
4113 * 0b1..Enabled. The I2C Master function is enabled.
4114 */
4115#define I2C_CFG_MSTEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_CFG_MSTEN_SHIFT)) & I2C_CFG_MSTEN_MASK)
4116#define I2C_CFG_SLVEN_MASK (0x2U)
4117#define I2C_CFG_SLVEN_SHIFT (1U)
4118/*! SLVEN - Slave Enable. When disabled, configurations settings for the Slave function are not
4119 * changed, but the Slave function is internally reset.
4120 * 0b0..Disabled. The I2C slave function is disabled.
4121 * 0b1..Enabled. The I2C slave function is enabled.
4122 */
4123#define I2C_CFG_SLVEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_CFG_SLVEN_SHIFT)) & I2C_CFG_SLVEN_MASK)
4124#define I2C_CFG_MONEN_MASK (0x4U)
4125#define I2C_CFG_MONEN_SHIFT (2U)
4126/*! MONEN - Monitor Enable. When disabled, configurations settings for the Monitor function are not
4127 * changed, but the Monitor function is internally reset.
4128 * 0b0..Disabled. The I2C Monitor function is disabled.
4129 * 0b1..Enabled. The I2C Monitor function is enabled.
4130 */
4131#define I2C_CFG_MONEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_CFG_MONEN_SHIFT)) & I2C_CFG_MONEN_MASK)
4132#define I2C_CFG_TIMEOUTEN_MASK (0x8U)
4133#define I2C_CFG_TIMEOUTEN_SHIFT (3U)
4134/*! TIMEOUTEN - I2C bus Time-out Enable. When disabled, the time-out function is internally reset.
4135 * 0b0..Disabled. Time-out function is disabled.
4136 * 0b1..Enabled. Time-out function is enabled. Both types of time-out flags will be generated and will cause
4137 * interrupts if they are enabled. Typically, only one time-out will be used in a system.
4138 */
4139#define I2C_CFG_TIMEOUTEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_CFG_TIMEOUTEN_SHIFT)) & I2C_CFG_TIMEOUTEN_MASK)
4140#define I2C_CFG_MONCLKSTR_MASK (0x10U)
4141#define I2C_CFG_MONCLKSTR_SHIFT (4U)
4142/*! MONCLKSTR - Monitor function Clock Stretching.
4143 * 0b0..Disabled. The Monitor function will not perform clock stretching. Software or DMA may not always be able
4144 * to read data provided by the Monitor function before it is overwritten. This mode may be used when
4145 * non-invasive monitoring is critical.
4146 * 0b1..Enabled. The Monitor function will perform clock stretching in order to ensure that software or DMA can
4147 * read all incoming data supplied by the Monitor function.
4148 */
4149#define I2C_CFG_MONCLKSTR(x) (((uint32_t)(((uint32_t)(x)) << I2C_CFG_MONCLKSTR_SHIFT)) & I2C_CFG_MONCLKSTR_MASK)
4150#define I2C_CFG_HSCAPABLE_MASK (0x20U)
4151#define I2C_CFG_HSCAPABLE_SHIFT (5U)
4152/*! HSCAPABLE - High-speed mode Capable enable. Since High Speed mode alters the way I2C pins drive
4153 * and filter, as well as the timing for certain I2C signalling, enabling High-speed mode applies
4154 * to all functions: Master, Slave, and Monitor.
4155 * 0b0..Fast-mode plus. The I 2C interface will support Standard-mode, Fast-mode, and Fast-mode Plus, to the
4156 * extent that the pin electronics support these modes. Any changes that need to be made to the pin controls,
4157 * such as changing the drive strength or filtering, must be made by software via the IOCON register associated
4158 * with each I2C pin,
4159 * 0b1..High-speed. In addition to Standard-mode, Fast-mode, and Fast-mode Plus, the I 2C interface will support
4160 * High-speed mode to the extent that the pin electronics support these modes. See Section 25.7.2.2 for more
4161 * information.
4162 */
4163#define I2C_CFG_HSCAPABLE(x) (((uint32_t)(((uint32_t)(x)) << I2C_CFG_HSCAPABLE_SHIFT)) & I2C_CFG_HSCAPABLE_MASK)
4164/*! @} */
4165
4166/*! @name STAT - Status register for Master, Slave, and Monitor functions. */
4167/*! @{ */
4168#define I2C_STAT_MSTPENDING_MASK (0x1U)
4169#define I2C_STAT_MSTPENDING_SHIFT (0U)
4170/*! MSTPENDING - Master Pending. Indicates that the Master is waiting to continue communication on
4171 * the I2C-bus (pending) or is idle. When the master is pending, the MSTSTATE bits indicate what
4172 * type of software service if any the master expects. This flag will cause an interrupt when set
4173 * if, enabled via the INTENSET register. The MSTPENDING flag is not set when the DMA is handling
4174 * an event (if the MSTDMA bit in the MSTCTL register is set). If the master is in the idle
4175 * state, and no communication is needed, mask this interrupt.
4176 * 0b0..In progress. Communication is in progress and the Master function is busy and cannot currently accept a command.
4177 * 0b1..Pending. The Master function needs software service or is in the idle state. If the master is not in the
4178 * idle state, it is waiting to receive or transmit data or the NACK bit.
4179 */
4180#define I2C_STAT_MSTPENDING(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_MSTPENDING_SHIFT)) & I2C_STAT_MSTPENDING_MASK)
4181#define I2C_STAT_MSTSTATE_MASK (0xEU)
4182#define I2C_STAT_MSTSTATE_SHIFT (1U)
4183/*! MSTSTATE - Master State code. The master state code reflects the master state when the
4184 * MSTPENDING bit is set, that is the master is pending or in the idle state. Each value of this field
4185 * indicates a specific required service for the Master function. All other values are reserved. See
4186 * Table 400 for details of state values and appropriate responses.
4187 * 0b000..Idle. The Master function is available to be used for a new transaction.
4188 * 0b001..Receive ready. Received data available (Master Receiver mode). Address plus Read was previously sent and Acknowledged by slave.
4189 * 0b010..Transmit ready. Data can be transmitted (Master Transmitter mode). Address plus Write was previously sent and Acknowledged by slave.
4190 * 0b011..NACK Address. Slave NACKed address.
4191 * 0b100..NACK Data. Slave NACKed transmitted data.
4192 */
4193#define I2C_STAT_MSTSTATE(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_MSTSTATE_SHIFT)) & I2C_STAT_MSTSTATE_MASK)
4194#define I2C_STAT_MSTARBLOSS_MASK (0x10U)
4195#define I2C_STAT_MSTARBLOSS_SHIFT (4U)
4196/*! MSTARBLOSS - Master Arbitration Loss flag. This flag can be cleared by software writing a 1 to
4197 * this bit. It is also cleared automatically a 1 is written to MSTCONTINUE.
4198 * 0b0..No Arbitration Loss has occurred.
4199 * 0b1..Arbitration loss. The Master function has experienced an Arbitration Loss. At this point, the Master
4200 * function has already stopped driving the bus and gone to an idle state. Software can respond by doing nothing,
4201 * or by sending a Start in order to attempt to gain control of the bus when it next becomes idle.
4202 */
4203#define I2C_STAT_MSTARBLOSS(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_MSTARBLOSS_SHIFT)) & I2C_STAT_MSTARBLOSS_MASK)
4204#define I2C_STAT_MSTSTSTPERR_MASK (0x40U)
4205#define I2C_STAT_MSTSTSTPERR_SHIFT (6U)
4206/*! MSTSTSTPERR - Master Start/Stop Error flag. This flag can be cleared by software writing a 1 to
4207 * this bit. It is also cleared automatically a 1 is written to MSTCONTINUE.
4208 * 0b0..No Start/Stop Error has occurred.
4209 * 0b1..The Master function has experienced a Start/Stop Error. A Start or Stop was detected at a time when it is
4210 * not allowed by the I2C specification. The Master interface has stopped driving the bus and gone to an
4211 * idle state, no action is required. A request for a Start could be made, or software could attempt to insure
4212 * that the bus has not stalled.
4213 */
4214#define I2C_STAT_MSTSTSTPERR(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_MSTSTSTPERR_SHIFT)) & I2C_STAT_MSTSTSTPERR_MASK)
4215#define I2C_STAT_SLVPENDING_MASK (0x100U)
4216#define I2C_STAT_SLVPENDING_SHIFT (8U)
4217/*! SLVPENDING - Slave Pending. Indicates that the Slave function is waiting to continue
4218 * communication on the I2C-bus and needs software service. This flag will cause an interrupt when set if
4219 * enabled via INTENSET. The SLVPENDING flag is not set when the DMA is handling an event (if the
4220 * SLVDMA bit in the SLVCTL register is set). The SLVPENDING flag is read-only and is
4221 * automatically cleared when a 1 is written to the SLVCONTINUE bit in the SLVCTL register. The point in time
4222 * when SlvPending is set depends on whether the I2C interface is in HSCAPABLE mode. See Section
4223 * 25.7.2.2.2. When the I2C interface is configured to be HSCAPABLE, HS master codes are
4224 * detected automatically. Due to the requirements of the HS I2C specification, slave addresses must
4225 * also be detected automatically, since the address must be acknowledged before the clock can be
4226 * stretched.
4227 * 0b0..In progress. The Slave function does not currently need service.
4228 * 0b1..Pending. The Slave function needs service. Information on what is needed can be found in the adjacent SLVSTATE field.
4229 */
4230#define I2C_STAT_SLVPENDING(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_SLVPENDING_SHIFT)) & I2C_STAT_SLVPENDING_MASK)
4231#define I2C_STAT_SLVSTATE_MASK (0x600U)
4232#define I2C_STAT_SLVSTATE_SHIFT (9U)
4233/*! SLVSTATE - Slave State code. Each value of this field indicates a specific required service for
4234 * the Slave function. All other values are reserved. See Table 401 for state values and actions.
4235 * note that the occurrence of some states and how they are handled are affected by DMA mode and
4236 * Automatic Operation modes.
4237 * 0b00..Slave address. Address plus R/W received. At least one of the four slave addresses has been matched by hardware.
4238 * 0b01..Slave receive. Received data is available (Slave Receiver mode).
4239 * 0b10..Slave transmit. Data can be transmitted (Slave Transmitter mode).
4240 */
4241#define I2C_STAT_SLVSTATE(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_SLVSTATE_SHIFT)) & I2C_STAT_SLVSTATE_MASK)
4242#define I2C_STAT_SLVNOTSTR_MASK (0x800U)
4243#define I2C_STAT_SLVNOTSTR_SHIFT (11U)
4244/*! SLVNOTSTR - Slave Not Stretching. Indicates when the slave function is stretching the I2C clock.
4245 * This is needed in order to gracefully invoke Deep Sleep or Power-down modes during slave
4246 * operation. This read-only flag reflects the slave function status in real time.
4247 * 0b0..Stretching. The slave function is currently stretching the I2C bus clock. Deep-Sleep or Power-down mode cannot be entered at this time.
4248 * 0b1..Not stretching. The slave function is not currently stretching the I 2C bus clock. Deep-sleep or
4249 * Power-down mode could be entered at this time.
4250 */
4251#define I2C_STAT_SLVNOTSTR(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_SLVNOTSTR_SHIFT)) & I2C_STAT_SLVNOTSTR_MASK)
4252#define I2C_STAT_SLVIDX_MASK (0x3000U)
4253#define I2C_STAT_SLVIDX_SHIFT (12U)
4254/*! SLVIDX - Slave address match Index. This field is valid when the I2C slave function has been
4255 * selected by receiving an address that matches one of the slave addresses defined by any enabled
4256 * slave address registers, and provides an identification of the address that was matched. It is
4257 * possible that more than one address could be matched, but only one match can be reported here.
4258 * 0b00..Address 0. Slave address 0 was matched.
4259 * 0b01..Address 1. Slave address 1 was matched.
4260 * 0b10..Address 2. Slave address 2 was matched.
4261 * 0b11..Address 3. Slave address 3 was matched.
4262 */
4263#define I2C_STAT_SLVIDX(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_SLVIDX_SHIFT)) & I2C_STAT_SLVIDX_MASK)
4264#define I2C_STAT_SLVSEL_MASK (0x4000U)
4265#define I2C_STAT_SLVSEL_SHIFT (14U)
4266/*! SLVSEL - Slave selected flag. SLVSEL is set after an address match when software tells the Slave
4267 * function to acknowledge the address, or when the address has been automatically acknowledged.
4268 * It is cleared when another address cycle presents an address that does not match an enabled
4269 * address on the Slave function, when slave software decides to NACK a matched address, when
4270 * there is a Stop detected on the bus, when the master NACKs slave data, and in some combinations of
4271 * Automatic Operation. SLVSEL is not cleared if software NACKs data.
4272 * 0b0..Not selected. The Slave function is not currently selected.
4273 * 0b1..Selected. The Slave function is currently selected.
4274 */
4275#define I2C_STAT_SLVSEL(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_SLVSEL_SHIFT)) & I2C_STAT_SLVSEL_MASK)
4276#define I2C_STAT_SLVDESEL_MASK (0x8000U)
4277#define I2C_STAT_SLVDESEL_SHIFT (15U)
4278/*! SLVDESEL - Slave Deselected flag. This flag will cause an interrupt when set if enabled via
4279 * INTENSET. This flag can be cleared by writing a 1 to this bit.
4280 * 0b0..Not deselected. The Slave function has not become deselected. This does not mean that it is currently
4281 * selected. That information can be found in the SLVSEL flag.
4282 * 0b1..Deselected. The Slave function has become deselected. This is specifically caused by the SLVSEL flag
4283 * changing from 1 to 0. See the description of SLVSEL for details on when that event occurs.
4284 */
4285#define I2C_STAT_SLVDESEL(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_SLVDESEL_SHIFT)) & I2C_STAT_SLVDESEL_MASK)
4286#define I2C_STAT_MONRDY_MASK (0x10000U)
4287#define I2C_STAT_MONRDY_SHIFT (16U)
4288/*! MONRDY - Monitor Ready. This flag is cleared when the MONRXDAT register is read.
4289 * 0b0..No data. The Monitor function does not currently have data available.
4290 * 0b1..Data waiting. The Monitor function has data waiting to be read.
4291 */
4292#define I2C_STAT_MONRDY(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_MONRDY_SHIFT)) & I2C_STAT_MONRDY_MASK)
4293#define I2C_STAT_MONOV_MASK (0x20000U)
4294#define I2C_STAT_MONOV_SHIFT (17U)
4295/*! MONOV - Monitor Overflow flag.
4296 * 0b0..No overrun. Monitor data has not overrun.
4297 * 0b1..Overrun. A Monitor data overrun has occurred. This can only happen when Monitor clock stretching not
4298 * enabled via the MONCLKSTR bit in the CFG register. Writing 1 to this bit clears the flag.
4299 */
4300#define I2C_STAT_MONOV(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_MONOV_SHIFT)) & I2C_STAT_MONOV_MASK)
4301#define I2C_STAT_MONACTIVE_MASK (0x40000U)
4302#define I2C_STAT_MONACTIVE_SHIFT (18U)
4303/*! MONACTIVE - Monitor Active flag. Indicates when the Monitor function considers the I 2C bus to
4304 * be active. Active is defined here as when some Master is on the bus: a bus Start has occurred
4305 * more recently than a bus Stop.
4306 * 0b0..Inactive. The Monitor function considers the I2C bus to be inactive.
4307 * 0b1..Active. The Monitor function considers the I2C bus to be active.
4308 */
4309#define I2C_STAT_MONACTIVE(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_MONACTIVE_SHIFT)) & I2C_STAT_MONACTIVE_MASK)
4310#define I2C_STAT_MONIDLE_MASK (0x80000U)
4311#define I2C_STAT_MONIDLE_SHIFT (19U)
4312/*! MONIDLE - Monitor Idle flag. This flag is set when the Monitor function sees the I2C bus change
4313 * from active to inactive. This can be used by software to decide when to process data
4314 * accumulated by the Monitor function. This flag will cause an interrupt when set if enabled via the
4315 * INTENSET register. The flag can be cleared by writing a 1 to this bit.
4316 * 0b0..Not idle. The I2C bus is not idle, or this flag has been cleared by software.
4317 * 0b1..Idle. The I2C bus has gone idle at least once since the last time this flag was cleared by software.
4318 */
4319#define I2C_STAT_MONIDLE(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_MONIDLE_SHIFT)) & I2C_STAT_MONIDLE_MASK)
4320#define I2C_STAT_EVENTTIMEOUT_MASK (0x1000000U)
4321#define I2C_STAT_EVENTTIMEOUT_SHIFT (24U)
4322/*! EVENTTIMEOUT - Event Time-out Interrupt flag. Indicates when the time between events has been
4323 * longer than the time specified by the TIMEOUT register. Events include Start, Stop, and clock
4324 * edges. The flag is cleared by writing a 1 to this bit. No time-out is created when the I2C-bus
4325 * is idle.
4326 * 0b0..No time-out. I2C bus events have not caused a time-out.
4327 * 0b1..Event time-out. The time between I2C bus events has been longer than the time specified by the TIMEOUT register.
4328 */
4329#define I2C_STAT_EVENTTIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_EVENTTIMEOUT_SHIFT)) & I2C_STAT_EVENTTIMEOUT_MASK)
4330#define I2C_STAT_SCLTIMEOUT_MASK (0x2000000U)
4331#define I2C_STAT_SCLTIMEOUT_SHIFT (25U)
4332/*! SCLTIMEOUT - SCL Time-out Interrupt flag. Indicates when SCL has remained low longer than the
4333 * time specific by the TIMEOUT register. The flag is cleared by writing a 1 to this bit.
4334 * 0b0..No time-out. SCL low time has not caused a time-out.
4335 * 0b1..Time-out. SCL low time has caused a time-out.
4336 */
4337#define I2C_STAT_SCLTIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << I2C_STAT_SCLTIMEOUT_SHIFT)) & I2C_STAT_SCLTIMEOUT_MASK)
4338/*! @} */
4339
4340/*! @name INTENSET - Interrupt Enable Set and read register. */
4341/*! @{ */
4342#define I2C_INTENSET_MSTPENDINGEN_MASK (0x1U)
4343#define I2C_INTENSET_MSTPENDINGEN_SHIFT (0U)
4344/*! MSTPENDINGEN - Master Pending interrupt Enable.
4345 * 0b0..Disabled. The MstPending interrupt is disabled.
4346 * 0b1..Enabled. The MstPending interrupt is enabled.
4347 */
4348#define I2C_INTENSET_MSTPENDINGEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENSET_MSTPENDINGEN_SHIFT)) & I2C_INTENSET_MSTPENDINGEN_MASK)
4349#define I2C_INTENSET_MSTARBLOSSEN_MASK (0x10U)
4350#define I2C_INTENSET_MSTARBLOSSEN_SHIFT (4U)
4351/*! MSTARBLOSSEN - Master Arbitration Loss interrupt Enable.
4352 * 0b0..Disabled. The MstArbLoss interrupt is disabled.
4353 * 0b1..Enabled. The MstArbLoss interrupt is enabled.
4354 */
4355#define I2C_INTENSET_MSTARBLOSSEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENSET_MSTARBLOSSEN_SHIFT)) & I2C_INTENSET_MSTARBLOSSEN_MASK)
4356#define I2C_INTENSET_MSTSTSTPERREN_MASK (0x40U)
4357#define I2C_INTENSET_MSTSTSTPERREN_SHIFT (6U)
4358/*! MSTSTSTPERREN - Master Start/Stop Error interrupt Enable.
4359 * 0b0..Disabled. The MstStStpErr interrupt is disabled.
4360 * 0b1..Enabled. The MstStStpErr interrupt is enabled.
4361 */
4362#define I2C_INTENSET_MSTSTSTPERREN(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENSET_MSTSTSTPERREN_SHIFT)) & I2C_INTENSET_MSTSTSTPERREN_MASK)
4363#define I2C_INTENSET_SLVPENDINGEN_MASK (0x100U)
4364#define I2C_INTENSET_SLVPENDINGEN_SHIFT (8U)
4365/*! SLVPENDINGEN - Slave Pending interrupt Enable.
4366 * 0b0..Disabled. The SlvPending interrupt is disabled.
4367 * 0b1..Enabled. The SlvPending interrupt is enabled.
4368 */
4369#define I2C_INTENSET_SLVPENDINGEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENSET_SLVPENDINGEN_SHIFT)) & I2C_INTENSET_SLVPENDINGEN_MASK)
4370#define I2C_INTENSET_SLVNOTSTREN_MASK (0x800U)
4371#define I2C_INTENSET_SLVNOTSTREN_SHIFT (11U)
4372/*! SLVNOTSTREN - Slave Not Stretching interrupt Enable.
4373 * 0b0..Disabled. The SlvNotStr interrupt is disabled.
4374 * 0b1..Enabled. The SlvNotStr interrupt is enabled.
4375 */
4376#define I2C_INTENSET_SLVNOTSTREN(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENSET_SLVNOTSTREN_SHIFT)) & I2C_INTENSET_SLVNOTSTREN_MASK)
4377#define I2C_INTENSET_SLVDESELEN_MASK (0x8000U)
4378#define I2C_INTENSET_SLVDESELEN_SHIFT (15U)
4379/*! SLVDESELEN - Slave Deselect interrupt Enable.
4380 * 0b0..Disabled. The SlvDeSel interrupt is disabled.
4381 * 0b1..Enabled. The SlvDeSel interrupt is enabled.
4382 */
4383#define I2C_INTENSET_SLVDESELEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENSET_SLVDESELEN_SHIFT)) & I2C_INTENSET_SLVDESELEN_MASK)
4384#define I2C_INTENSET_MONRDYEN_MASK (0x10000U)
4385#define I2C_INTENSET_MONRDYEN_SHIFT (16U)
4386/*! MONRDYEN - Monitor data Ready interrupt Enable.
4387 * 0b0..Disabled. The MonRdy interrupt is disabled.
4388 * 0b1..Enabled. The MonRdy interrupt is enabled.
4389 */
4390#define I2C_INTENSET_MONRDYEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENSET_MONRDYEN_SHIFT)) & I2C_INTENSET_MONRDYEN_MASK)
4391#define I2C_INTENSET_MONOVEN_MASK (0x20000U)
4392#define I2C_INTENSET_MONOVEN_SHIFT (17U)
4393/*! MONOVEN - Monitor Overrun interrupt Enable.
4394 * 0b0..Disabled. The MonOv interrupt is disabled.
4395 * 0b1..Enabled. The MonOv interrupt is enabled.
4396 */
4397#define I2C_INTENSET_MONOVEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENSET_MONOVEN_SHIFT)) & I2C_INTENSET_MONOVEN_MASK)
4398#define I2C_INTENSET_MONIDLEEN_MASK (0x80000U)
4399#define I2C_INTENSET_MONIDLEEN_SHIFT (19U)
4400/*! MONIDLEEN - Monitor Idle interrupt Enable.
4401 * 0b0..Disabled. The MonIdle interrupt is disabled.
4402 * 0b1..Enabled. The MonIdle interrupt is enabled.
4403 */
4404#define I2C_INTENSET_MONIDLEEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENSET_MONIDLEEN_SHIFT)) & I2C_INTENSET_MONIDLEEN_MASK)
4405#define I2C_INTENSET_EVENTTIMEOUTEN_MASK (0x1000000U)
4406#define I2C_INTENSET_EVENTTIMEOUTEN_SHIFT (24U)
4407/*! EVENTTIMEOUTEN - Event time-out interrupt Enable.
4408 * 0b0..Disabled. The Event time-out interrupt is disabled.
4409 * 0b1..Enabled. The Event time-out interrupt is enabled.
4410 */
4411#define I2C_INTENSET_EVENTTIMEOUTEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENSET_EVENTTIMEOUTEN_SHIFT)) & I2C_INTENSET_EVENTTIMEOUTEN_MASK)
4412#define I2C_INTENSET_SCLTIMEOUTEN_MASK (0x2000000U)
4413#define I2C_INTENSET_SCLTIMEOUTEN_SHIFT (25U)
4414/*! SCLTIMEOUTEN - SCL time-out interrupt Enable.
4415 * 0b0..Disabled. The SCL time-out interrupt is disabled.
4416 * 0b1..Enabled. The SCL time-out interrupt is enabled.
4417 */
4418#define I2C_INTENSET_SCLTIMEOUTEN(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENSET_SCLTIMEOUTEN_SHIFT)) & I2C_INTENSET_SCLTIMEOUTEN_MASK)
4419/*! @} */
4420
4421/*! @name INTENCLR - Interrupt Enable Clear register. */
4422/*! @{ */
4423#define I2C_INTENCLR_MSTPENDINGCLR_MASK (0x1U)
4424#define I2C_INTENCLR_MSTPENDINGCLR_SHIFT (0U)
4425/*! MSTPENDINGCLR - Master Pending interrupt clear. Writing 1 to this bit clears the corresponding
4426 * bit in the INTENSET register if implemented.
4427 */
4428#define I2C_INTENCLR_MSTPENDINGCLR(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENCLR_MSTPENDINGCLR_SHIFT)) & I2C_INTENCLR_MSTPENDINGCLR_MASK)
4429#define I2C_INTENCLR_MSTARBLOSSCLR_MASK (0x10U)
4430#define I2C_INTENCLR_MSTARBLOSSCLR_SHIFT (4U)
4431/*! MSTARBLOSSCLR - Master Arbitration Loss interrupt clear.
4432 */
4433#define I2C_INTENCLR_MSTARBLOSSCLR(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENCLR_MSTARBLOSSCLR_SHIFT)) & I2C_INTENCLR_MSTARBLOSSCLR_MASK)
4434#define I2C_INTENCLR_MSTSTSTPERRCLR_MASK (0x40U)
4435#define I2C_INTENCLR_MSTSTSTPERRCLR_SHIFT (6U)
4436/*! MSTSTSTPERRCLR - Master Start/Stop Error interrupt clear.
4437 */
4438#define I2C_INTENCLR_MSTSTSTPERRCLR(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENCLR_MSTSTSTPERRCLR_SHIFT)) & I2C_INTENCLR_MSTSTSTPERRCLR_MASK)
4439#define I2C_INTENCLR_SLVPENDINGCLR_MASK (0x100U)
4440#define I2C_INTENCLR_SLVPENDINGCLR_SHIFT (8U)
4441/*! SLVPENDINGCLR - Slave Pending interrupt clear.
4442 */
4443#define I2C_INTENCLR_SLVPENDINGCLR(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENCLR_SLVPENDINGCLR_SHIFT)) & I2C_INTENCLR_SLVPENDINGCLR_MASK)
4444#define I2C_INTENCLR_SLVNOTSTRCLR_MASK (0x800U)
4445#define I2C_INTENCLR_SLVNOTSTRCLR_SHIFT (11U)
4446/*! SLVNOTSTRCLR - Slave Not Stretching interrupt clear.
4447 */
4448#define I2C_INTENCLR_SLVNOTSTRCLR(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENCLR_SLVNOTSTRCLR_SHIFT)) & I2C_INTENCLR_SLVNOTSTRCLR_MASK)
4449#define I2C_INTENCLR_SLVDESELCLR_MASK (0x8000U)
4450#define I2C_INTENCLR_SLVDESELCLR_SHIFT (15U)
4451/*! SLVDESELCLR - Slave Deselect interrupt clear.
4452 */
4453#define I2C_INTENCLR_SLVDESELCLR(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENCLR_SLVDESELCLR_SHIFT)) & I2C_INTENCLR_SLVDESELCLR_MASK)
4454#define I2C_INTENCLR_MONRDYCLR_MASK (0x10000U)
4455#define I2C_INTENCLR_MONRDYCLR_SHIFT (16U)
4456/*! MONRDYCLR - Monitor data Ready interrupt clear.
4457 */
4458#define I2C_INTENCLR_MONRDYCLR(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENCLR_MONRDYCLR_SHIFT)) & I2C_INTENCLR_MONRDYCLR_MASK)
4459#define I2C_INTENCLR_MONOVCLR_MASK (0x20000U)
4460#define I2C_INTENCLR_MONOVCLR_SHIFT (17U)
4461/*! MONOVCLR - Monitor Overrun interrupt clear.
4462 */
4463#define I2C_INTENCLR_MONOVCLR(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENCLR_MONOVCLR_SHIFT)) & I2C_INTENCLR_MONOVCLR_MASK)
4464#define I2C_INTENCLR_MONIDLECLR_MASK (0x80000U)
4465#define I2C_INTENCLR_MONIDLECLR_SHIFT (19U)
4466/*! MONIDLECLR - Monitor Idle interrupt clear.
4467 */
4468#define I2C_INTENCLR_MONIDLECLR(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENCLR_MONIDLECLR_SHIFT)) & I2C_INTENCLR_MONIDLECLR_MASK)
4469#define I2C_INTENCLR_EVENTTIMEOUTCLR_MASK (0x1000000U)
4470#define I2C_INTENCLR_EVENTTIMEOUTCLR_SHIFT (24U)
4471/*! EVENTTIMEOUTCLR - Event time-out interrupt clear.
4472 */
4473#define I2C_INTENCLR_EVENTTIMEOUTCLR(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENCLR_EVENTTIMEOUTCLR_SHIFT)) & I2C_INTENCLR_EVENTTIMEOUTCLR_MASK)
4474#define I2C_INTENCLR_SCLTIMEOUTCLR_MASK (0x2000000U)
4475#define I2C_INTENCLR_SCLTIMEOUTCLR_SHIFT (25U)
4476/*! SCLTIMEOUTCLR - SCL time-out interrupt clear.
4477 */
4478#define I2C_INTENCLR_SCLTIMEOUTCLR(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTENCLR_SCLTIMEOUTCLR_SHIFT)) & I2C_INTENCLR_SCLTIMEOUTCLR_MASK)
4479/*! @} */
4480
4481/*! @name TIMEOUT - Time-out value register. */
4482/*! @{ */
4483#define I2C_TIMEOUT_TOMIN_MASK (0xFU)
4484#define I2C_TIMEOUT_TOMIN_SHIFT (0U)
4485/*! TOMIN - Time-out time value, bottom four bits. These are hard-wired to 0xF. This gives a minimum
4486 * time-out of 16 I2C function clocks and also a time-out resolution of 16 I2C function clocks.
4487 */
4488#define I2C_TIMEOUT_TOMIN(x) (((uint32_t)(((uint32_t)(x)) << I2C_TIMEOUT_TOMIN_SHIFT)) & I2C_TIMEOUT_TOMIN_MASK)
4489#define I2C_TIMEOUT_TO_MASK (0xFFF0U)
4490#define I2C_TIMEOUT_TO_SHIFT (4U)
4491/*! TO - Time-out time value. Specifies the time-out interval value in increments of 16 I 2C
4492 * function clocks, as defined by the CLKDIV register. To change this value while I2C is in operation,
4493 * disable all time-outs, write a new value to TIMEOUT, then re-enable time-outs. 0x000 = A
4494 * time-out will occur after 16 counts of the I2C function clock. 0x001 = A time-out will occur after
4495 * 32 counts of the I2C function clock. 0xFFF = A time-out will occur after 65,536 counts of the
4496 * I2C function clock.
4497 */
4498#define I2C_TIMEOUT_TO(x) (((uint32_t)(((uint32_t)(x)) << I2C_TIMEOUT_TO_SHIFT)) & I2C_TIMEOUT_TO_MASK)
4499/*! @} */
4500
4501/*! @name 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. */
4502/*! @{ */
4503#define I2C_CLKDIV_DIVVAL_MASK (0xFFFFU)
4504#define I2C_CLKDIV_DIVVAL_SHIFT (0U)
4505/*! DIVVAL - This field controls how the Flexcomm clock (FCLK) is used by the I2C functions that
4506 * need an internal clock in order to operate. 0x0000 = FCLK is used directly by the I2C. 0x0001 =
4507 * FCLK is divided by 2 before use. 0x0002 = FCLK is divided by 3 before use. 0xFFFF = FCLK is
4508 * divided by 65,536 before use.
4509 */
4510#define I2C_CLKDIV_DIVVAL(x) (((uint32_t)(((uint32_t)(x)) << I2C_CLKDIV_DIVVAL_SHIFT)) & I2C_CLKDIV_DIVVAL_MASK)
4511/*! @} */
4512
4513/*! @name INTSTAT - Interrupt Status register for Master, Slave, and Monitor functions. */
4514/*! @{ */
4515#define I2C_INTSTAT_MSTPENDING_MASK (0x1U)
4516#define I2C_INTSTAT_MSTPENDING_SHIFT (0U)
4517/*! MSTPENDING - Master Pending.
4518 */
4519#define I2C_INTSTAT_MSTPENDING(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTSTAT_MSTPENDING_SHIFT)) & I2C_INTSTAT_MSTPENDING_MASK)
4520#define I2C_INTSTAT_MSTARBLOSS_MASK (0x10U)
4521#define I2C_INTSTAT_MSTARBLOSS_SHIFT (4U)
4522/*! MSTARBLOSS - Master Arbitration Loss flag.
4523 */
4524#define I2C_INTSTAT_MSTARBLOSS(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTSTAT_MSTARBLOSS_SHIFT)) & I2C_INTSTAT_MSTARBLOSS_MASK)
4525#define I2C_INTSTAT_MSTSTSTPERR_MASK (0x40U)
4526#define I2C_INTSTAT_MSTSTSTPERR_SHIFT (6U)
4527/*! MSTSTSTPERR - Master Start/Stop Error flag.
4528 */
4529#define I2C_INTSTAT_MSTSTSTPERR(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTSTAT_MSTSTSTPERR_SHIFT)) & I2C_INTSTAT_MSTSTSTPERR_MASK)
4530#define I2C_INTSTAT_SLVPENDING_MASK (0x100U)
4531#define I2C_INTSTAT_SLVPENDING_SHIFT (8U)
4532/*! SLVPENDING - Slave Pending.
4533 */
4534#define I2C_INTSTAT_SLVPENDING(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTSTAT_SLVPENDING_SHIFT)) & I2C_INTSTAT_SLVPENDING_MASK)
4535#define I2C_INTSTAT_SLVNOTSTR_MASK (0x800U)
4536#define I2C_INTSTAT_SLVNOTSTR_SHIFT (11U)
4537/*! SLVNOTSTR - Slave Not Stretching status.
4538 */
4539#define I2C_INTSTAT_SLVNOTSTR(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTSTAT_SLVNOTSTR_SHIFT)) & I2C_INTSTAT_SLVNOTSTR_MASK)
4540#define I2C_INTSTAT_SLVDESEL_MASK (0x8000U)
4541#define I2C_INTSTAT_SLVDESEL_SHIFT (15U)
4542/*! SLVDESEL - Slave Deselected flag.
4543 */
4544#define I2C_INTSTAT_SLVDESEL(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTSTAT_SLVDESEL_SHIFT)) & I2C_INTSTAT_SLVDESEL_MASK)
4545#define I2C_INTSTAT_MONRDY_MASK (0x10000U)
4546#define I2C_INTSTAT_MONRDY_SHIFT (16U)
4547/*! MONRDY - Monitor Ready.
4548 */
4549#define I2C_INTSTAT_MONRDY(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTSTAT_MONRDY_SHIFT)) & I2C_INTSTAT_MONRDY_MASK)
4550#define I2C_INTSTAT_MONOV_MASK (0x20000U)
4551#define I2C_INTSTAT_MONOV_SHIFT (17U)
4552/*! MONOV - Monitor Overflow flag.
4553 */
4554#define I2C_INTSTAT_MONOV(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTSTAT_MONOV_SHIFT)) & I2C_INTSTAT_MONOV_MASK)
4555#define I2C_INTSTAT_MONIDLE_MASK (0x80000U)
4556#define I2C_INTSTAT_MONIDLE_SHIFT (19U)
4557/*! MONIDLE - Monitor Idle flag.
4558 */
4559#define I2C_INTSTAT_MONIDLE(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTSTAT_MONIDLE_SHIFT)) & I2C_INTSTAT_MONIDLE_MASK)
4560#define I2C_INTSTAT_EVENTTIMEOUT_MASK (0x1000000U)
4561#define I2C_INTSTAT_EVENTTIMEOUT_SHIFT (24U)
4562/*! EVENTTIMEOUT - Event time-out Interrupt flag.
4563 */
4564#define I2C_INTSTAT_EVENTTIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTSTAT_EVENTTIMEOUT_SHIFT)) & I2C_INTSTAT_EVENTTIMEOUT_MASK)
4565#define I2C_INTSTAT_SCLTIMEOUT_MASK (0x2000000U)
4566#define I2C_INTSTAT_SCLTIMEOUT_SHIFT (25U)
4567/*! SCLTIMEOUT - SCL time-out Interrupt flag.
4568 */
4569#define I2C_INTSTAT_SCLTIMEOUT(x) (((uint32_t)(((uint32_t)(x)) << I2C_INTSTAT_SCLTIMEOUT_SHIFT)) & I2C_INTSTAT_SCLTIMEOUT_MASK)
4570/*! @} */
4571
4572/*! @name MSTCTL - Master control register. */
4573/*! @{ */
4574#define I2C_MSTCTL_MSTCONTINUE_MASK (0x1U)
4575#define I2C_MSTCTL_MSTCONTINUE_SHIFT (0U)
4576/*! MSTCONTINUE - Master Continue. This bit is write-only.
4577 * 0b0..No effect.
4578 * 0b1..Continue. Informs the Master function to continue to the next operation. This must done after writing
4579 * transmit data, reading received data, or any other housekeeping related to the next bus operation.
4580 */
4581#define I2C_MSTCTL_MSTCONTINUE(x) (((uint32_t)(((uint32_t)(x)) << I2C_MSTCTL_MSTCONTINUE_SHIFT)) & I2C_MSTCTL_MSTCONTINUE_MASK)
4582#define I2C_MSTCTL_MSTSTART_MASK (0x2U)
4583#define I2C_MSTCTL_MSTSTART_SHIFT (1U)
4584/*! MSTSTART - Master Start control. This bit is write-only.
4585 * 0b0..No effect.
4586 * 0b1..Start. A Start will be generated on the I2C bus at the next allowed time.
4587 */
4588#define I2C_MSTCTL_MSTSTART(x) (((uint32_t)(((uint32_t)(x)) << I2C_MSTCTL_MSTSTART_SHIFT)) & I2C_MSTCTL_MSTSTART_MASK)
4589#define I2C_MSTCTL_MSTSTOP_MASK (0x4U)
4590#define I2C_MSTCTL_MSTSTOP_SHIFT (2U)
4591/*! MSTSTOP - Master Stop control. This bit is write-only.
4592 * 0b0..No effect.
4593 * 0b1..Stop. A Stop will be generated on the I2C bus at the next allowed time, preceded by a NACK to the slave
4594 * if the master is receiving data from the slave (Master Receiver mode).
4595 */
4596#define I2C_MSTCTL_MSTSTOP(x) (((uint32_t)(((uint32_t)(x)) << I2C_MSTCTL_MSTSTOP_SHIFT)) & I2C_MSTCTL_MSTSTOP_MASK)
4597#define I2C_MSTCTL_MSTDMA_MASK (0x8U)
4598#define I2C_MSTCTL_MSTDMA_SHIFT (3U)
4599/*! MSTDMA - Master DMA enable. Data operations of the I2C can be performed with DMA. Protocol type
4600 * operations such as Start, address, Stop, and address match must always be done with software,
4601 * typically via an interrupt. Address acknowledgement must also be done by software except when
4602 * the I2C is configured to be HSCAPABLE (and address acknowledgement is handled entirely by
4603 * hardware) or when Automatic Operation is enabled. When a DMA data transfer is complete, MSTDMA
4604 * must be cleared prior to beginning the next operation, typically a Start or Stop.This bit is
4605 * read/write.
4606 * 0b0..Disable. No DMA requests are generated for master operation.
4607 * 0b1..Enable. A DMA request is generated for I2C master data operations. When this I2C master is generating
4608 * Acknowledge bits in Master Receiver mode, the acknowledge is generated automatically.
4609 */
4610#define I2C_MSTCTL_MSTDMA(x) (((uint32_t)(((uint32_t)(x)) << I2C_MSTCTL_MSTDMA_SHIFT)) & I2C_MSTCTL_MSTDMA_MASK)
4611/*! @} */
4612
4613/*! @name MSTTIME - Master timing configuration. */
4614/*! @{ */
4615#define I2C_MSTTIME_MSTSCLLOW_MASK (0x7U)
4616#define I2C_MSTTIME_MSTSCLLOW_SHIFT (0U)
4617/*! MSTSCLLOW - Master SCL Low time. Specifies the minimum low time that will be asserted by this
4618 * master on SCL. Other devices on the bus (masters or slaves) could lengthen this time. This
4619 * corresponds to the parameter t LOW in the I2C bus specification. I2C bus specification parameters
4620 * tBUF and tSU;STA have the same values and are also controlled by MSTSCLLOW.
4621 * 0b000..2 clocks. Minimum SCL low time is 2 clocks of the I2C clock pre-divider.
4622 * 0b001..3 clocks. Minimum SCL low time is 3 clocks of the I2C clock pre-divider.
4623 * 0b010..4 clocks. Minimum SCL low time is 4 clocks of the I2C clock pre-divider.
4624 * 0b011..5 clocks. Minimum SCL low time is 5 clocks of the I2C clock pre-divider.
4625 * 0b100..6 clocks. Minimum SCL low time is 6 clocks of the I2C clock pre-divider.
4626 * 0b101..7 clocks. Minimum SCL low time is 7 clocks of the I2C clock pre-divider.
4627 * 0b110..8 clocks. Minimum SCL low time is 8 clocks of the I2C clock pre-divider.
4628 * 0b111..9 clocks. Minimum SCL low time is 9 clocks of the I2C clock pre-divider.
4629 */
4630#define I2C_MSTTIME_MSTSCLLOW(x) (((uint32_t)(((uint32_t)(x)) << I2C_MSTTIME_MSTSCLLOW_SHIFT)) & I2C_MSTTIME_MSTSCLLOW_MASK)
4631#define I2C_MSTTIME_MSTSCLHIGH_MASK (0x70U)
4632#define I2C_MSTTIME_MSTSCLHIGH_SHIFT (4U)
4633/*! MSTSCLHIGH - Master SCL High time. Specifies the minimum high time that will be asserted by this
4634 * master on SCL. Other masters in a multi-master system could shorten this time. This
4635 * corresponds to the parameter tHIGH in the I2C bus specification. I2C bus specification parameters
4636 * tSU;STO and tHD;STA have the same values and are also controlled by MSTSCLHIGH.
4637 * 0b000..2 clocks. Minimum SCL high time is 2 clock of the I2C clock pre-divider.
4638 * 0b001..3 clocks. Minimum SCL high time is 3 clocks of the I2C clock pre-divider .
4639 * 0b0