YAHAL
Yet Another Hardware Abstraction Library
Loading...
Searching...
No Matches
RP2040_regs.h
1
2// This file was generated with svd2cpp, source file was RP2040_regs.svd
3// DO NOT EDIT - CHANGES MIGHT BE OVERWRITTEN !!
5//
6#include "bitfield_defs.h"
7
8// vendor: Raspberry Pi
9// name: RP2040
10// version: 0.1
11// description:
12// Dual-core Arm Cortex-M0+ processor, flexible clock running up to 133 MHz
13// 264KB on-chip SRAM
14// 2 x UART, 2 x SPI controllers, 2 x I2C controllers, 16 x PWM channels
15// 1 x USB 1.1 controller and PHY, with host and device support
16// 8 x Programmable I/O (PIO) state machines for custom peripheral support
17// Supported input power 1.8-5.5V DC
18// Operating temperature -20C to +85C
19// Drag-and-drop programming using mass storage over USB
20// Low-power sleep and dormant modes
21// Accurate on-chip clock
22// Temperature sensor
23// Accelerated integer and floating-point libraries on-chip
24// licenseText:
25// Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
26//
27// SPDX-License-Identifier: BSD-3-Clause
28// cpu
29// name: CM0PLUS
30// revision: r0p1
31// endian: little
32// mpuPresent: true
33// fpuPresent: false
34// vtorPresent: 1
35// nvicPrioBits: 2
36// vendorSystickConfig: false
37// deviceNumInterrupts: 26
38// addressUnitBits: 8
39// width: 32
40
41// QSPI flash execute-in-place block
42namespace _XIP_CTRL_ {
43
44 // Cache control
45 // Reset value: 0x00000003
46 BEGIN_TYPE(CTRL_t, uint32_t)
47 // When 1, the cache memories are powered down. They retain state,
48 // but can not be accessed. This reduces static power dissipation.
49 // Writing 1 to this bit forces CTRL_EN to 0, i.e. the cache cannot
50 // be enabled when powered down.
51 // Cache-as-SRAM accesses will produce a bus error response when
52 // the cache is powered down.
53 ADD_BITFIELD_RW(POWER_DOWN, 3, 1)
54 // When 1, writes to any alias other than 0x0 (caching, allocating)
55 // will produce a bus fault. When 0, these writes are silently ignored.
56 // In either case, writes to the 0x0 alias will deallocate on tag match,
57 // as usual.
58 ADD_BITFIELD_RW(ERR_BADWRITE, 1, 1)
59 // When 1, enable the cache. When the cache is disabled, all XIP accesses
60 // will go straight to the flash, without querying the cache. When enabled,
61 // cacheable XIP accesses will query the cache, and the flash will
62 // not be accessed if the tag matches and the valid bit is set.
63 //
64 // If the cache is enabled, cache-as-SRAM accesses have no effect on the
65 // cache data RAM, and will produce a bus error response.
66 ADD_BITFIELD_RW(EN, 0, 1)
67 END_TYPE()
68
69 // Cache Flush control
70 // Reset value: 0x00000000
71 BEGIN_TYPE(FLUSH_t, uint32_t)
72 // Write 1 to flush the cache. This clears the tag memory, but
73 // the data memory retains its contents. (This means cache-as-SRAM
74 // contents is not affected by flush or reset.)
75 // Reading will hold the bus (stall the processor) until the flush
76 // completes. Alternatively STAT can be polled until completion.
77 ADD_BITFIELD_RW(FLUSH, 0, 1)
78 END_TYPE()
79
80 // Cache Status
81 // Reset value: 0x00000002
82 BEGIN_TYPE(STAT_t, uint32_t)
83 // When 1, indicates the XIP streaming FIFO is completely full.
84 // The streaming FIFO is 2 entries deep, so the full and empty
85 // flag allow its level to be ascertained.
86 ADD_BITFIELD_RO(FIFO_FULL, 2, 1)
87 // When 1, indicates the XIP streaming FIFO is completely empty.
88 ADD_BITFIELD_RO(FIFO_EMPTY, 1, 1)
89 // Reads as 0 while a cache flush is in progress, and 1 otherwise.
90 // The cache is flushed whenever the XIP block is reset, and also
91 // when requested via the FLUSH register.
92 ADD_BITFIELD_RO(FLUSH_READY, 0, 1)
93 END_TYPE()
94
95 // Cache Hit counter
96 // A 32 bit saturating counter that increments upon each cache hit,
97 // i.e. when an XIP access is serviced directly from cached data.
98 // Write any value to clear.
99 // Reset value: 0x00000000
100 typedef uint32_t CTR_HIT_t;
101
102 // Cache Access counter
103 // A 32 bit saturating counter that increments upon each XIP access,
104 // whether the cache is hit or not. This includes noncacheable accesses.
105 // Write any value to clear.
106 // Reset value: 0x00000000
107 typedef uint32_t CTR_ACC_t;
108
109 // FIFO stream address
110 // Reset value: 0x00000000
111 BEGIN_TYPE(STREAM_ADDR_t, uint32_t)
112 // The address of the next word to be streamed from flash to the streaming FIFO.
113 // Increments automatically after each flash access.
114 // Write the initial access address here before starting a streaming read.
115 ADD_BITFIELD_RW(STREAM_ADDR, 2, 30)
116 END_TYPE()
117
118 // FIFO stream control
119 // Reset value: 0x00000000
120 BEGIN_TYPE(STREAM_CTR_t, uint32_t)
121 // Write a nonzero value to start a streaming read. This will then
122 // progress in the background, using flash idle cycles to transfer
123 // a linear data block from flash to the streaming FIFO.
124 // Decrements automatically (1 at a time) as the stream
125 // progresses, and halts on reaching 0.
126 // Write 0 to halt an in-progress stream, and discard any in-flight
127 // read, so that a new stream can immediately be started (after
128 // draining the FIFO and reinitialising STREAM_ADDR)
129 ADD_BITFIELD_RW(STREAM_CTR, 0, 22)
130 END_TYPE()
131
132 // FIFO stream data
133 // Streamed data is buffered here, for retrieval by the system DMA.
134 // This FIFO can also be accessed via the XIP_AUX slave, to avoid exposing
135 // the DMA to bus stalls caused by other XIP traffic.
136 // Reset value: 0x00000000
137 typedef uint32_t STREAM_FIFO_t;
138
139 struct XIP_CTRL_t {
140 CTRL_t CTRL;
141 FLUSH_t FLUSH;
142 STAT_t STAT;
143 CTR_HIT_t CTR_HIT;
144 CTR_ACC_t CTR_ACC;
145 STREAM_ADDR_t STREAM_ADDR;
146 STREAM_CTR_t STREAM_CTR;
147 STREAM_FIFO_t STREAM_FIFO;
148 };
149
150 static XIP_CTRL_t & XIP_CTRL = (*(XIP_CTRL_t *)0x14000000);
151 static XIP_CTRL_t & XIP_CTRL_XOR = (*(XIP_CTRL_t *)0x14001000);
152 static XIP_CTRL_t & XIP_CTRL_SET = (*(XIP_CTRL_t *)0x14002000);
153 static XIP_CTRL_t & XIP_CTRL_CLR = (*(XIP_CTRL_t *)0x14003000);
154
155} // _XIP_CTRL_
156
157// DW_apb_ssi has the following features:
158// * APB interface - Allows for easy integration into a DesignWare Synthesizable Components for AMBA 2 implementation.
159// * APB3 and APB4 protocol support.
160// * Scalable APB data bus width - Supports APB data bus widths of 8, 16, and 32 bits.
161// * Serial-master or serial-slave operation - Enables serial communication with serial-master or serial-slave peripheral devices.
162// * Programmable Dual/Quad/Octal SPI support in Master Mode.
163// * Dual Data Rate (DDR) and Read Data Strobe (RDS) Support - Enables the DW_apb_ssi master to perform operations with the device in DDR and RDS modes when working in Dual/Quad/Octal mode of operation.
164// * Data Mask Support - Enables the DW_apb_ssi to selectively update the bytes in the device. This feature is applicable only in enhanced SPI modes.
165// * eXecute-In-Place (XIP) support - Enables the DW_apb_ssi master to behave as a memory mapped I/O and fetches the data from the device based on the APB read request. This feature is applicable only in enhanced SPI modes.
166// * DMA Controller Interface - Enables the DW_apb_ssi to interface to a DMA controller over the bus using a handshaking interface for transfer requests.
167// * Independent masking of interrupts - Master collision, transmit FIFO overflow, transmit FIFO empty, receive FIFO full, receive FIFO underflow, and receive FIFO overflow interrupts can all be masked independently.
168// * Multi-master contention detection - Informs the processor of multiple serial-master accesses on the serial bus.
169// * Bypass of meta-stability flip-flops for synchronous clocks - When the APB clock (pclk) and the DW_apb_ssi serial clock (ssi_clk) are synchronous, meta-stable flip-flops are not used when transferring control signals across these clock domains.
170// * Programmable delay on the sample time of the received serial data bit (rxd); enables programmable control of routing delays resulting in higher serial data-bit rates.
171// * Programmable features:
172// - Serial interface operation - Choice of Motorola SPI, Texas Instruments Synchronous Serial Protocol or National Semiconductor Microwire.
173// - Clock bit-rate - Dynamic control of the serial bit rate of the data transfer; used in only serial-master mode of operation.
174// - Data Item size (4 to 32 bits) - Item size of each data transfer under the control of the programmer.
175// * Configured features:
176// - FIFO depth - 16 words deep. The FIFO width is fixed at 32 bits.
177// - 1 slave select output.
178// - Hardware slave-select - Dedicated hardware slave-select line.
179// - Combined interrupt line - one combined interrupt line from the DW_apb_ssi to the interrupt controller.
180// - Interrupt polarity - active high interrupt lines.
181// - Serial clock polarity - low serial-clock polarity directly after reset.
182// - Serial clock phase - capture on first edge of serial-clock directly after reset.
183namespace _XIP_SSI_ {
184
185 // Control register 0
186 // Reset value: 0x00000000
187 BEGIN_TYPE(CTRLR0_t, uint32_t)
188 // Slave select toggle enable
189 ADD_BITFIELD_RW(SSTE, 24, 1)
190 // SPI frame format
191 ADD_BITFIELD_RW(SPI_FRF, 21, 2)
192 // Data frame size in 32b transfer mode
193 // Value of n -> n+1 clocks per frame.
194 ADD_BITFIELD_RW(DFS_32, 16, 5)
195 // Control frame size
196 // Value of n -> n+1 clocks per frame.
197 ADD_BITFIELD_RW(CFS, 12, 4)
198 // Shift register loop (test mode)
199 ADD_BITFIELD_RW(SRL, 11, 1)
200 // Slave output enable
201 ADD_BITFIELD_RW(SLV_OE, 10, 1)
202 // Transfer mode
203 ADD_BITFIELD_RW(TMOD, 8, 2)
204 // Serial clock polarity
205 ADD_BITFIELD_RW(SCPOL, 7, 1)
206 // Serial clock phase
207 ADD_BITFIELD_RW(SCPH, 6, 1)
208 // Frame format
209 ADD_BITFIELD_RW(FRF, 4, 2)
210 // Data frame size
211 ADD_BITFIELD_RW(DFS, 0, 4)
212 END_TYPE()
213
214 // Standard 1-bit SPI frame format; 1 bit per SCK, full-duplex
215 static const uint32_t CTRLR0_SPI_FRF__STD = 0;
216 // Dual-SPI frame format; two bits per SCK, half-duplex
217 static const uint32_t CTRLR0_SPI_FRF__DUAL = 1;
218 // Quad-SPI frame format; four bits per SCK, half-duplex
219 static const uint32_t CTRLR0_SPI_FRF__QUAD = 2;
220 // Both transmit and receive
221 static const uint32_t CTRLR0_TMOD__TX_AND_RX = 0;
222 // Transmit only (not for FRF == 0, standard SPI mode)
223 static const uint32_t CTRLR0_TMOD__TX_ONLY = 1;
224 // Receive only (not for FRF == 0, standard SPI mode)
225 static const uint32_t CTRLR0_TMOD__RX_ONLY = 2;
226 // EEPROM read mode (TX then RX; RX starts after control data TX'd)
227 static const uint32_t CTRLR0_TMOD__EEPROM_READ = 3;
228
229 // Master Control register 1
230 // Reset value: 0x00000000
231 BEGIN_TYPE(CTRLR1_t, uint32_t)
232 // Number of data frames
233 ADD_BITFIELD_RW(NDF, 0, 16)
234 END_TYPE()
235
236 // SSI Enable
237 // Reset value: 0x00000000
238 BEGIN_TYPE(SSIENR_t, uint32_t)
239 // SSI enable
240 ADD_BITFIELD_RW(SSI_EN, 0, 1)
241 END_TYPE()
242
243 // Microwire Control
244 // Reset value: 0x00000000
245 BEGIN_TYPE(MWCR_t, uint32_t)
246 // Microwire handshaking
247 ADD_BITFIELD_RW(MHS, 2, 1)
248 // Microwire control
249 ADD_BITFIELD_RW(MDD, 1, 1)
250 // Microwire transfer mode
251 ADD_BITFIELD_RW(MWMOD, 0, 1)
252 END_TYPE()
253
254 // Slave enable
255 // Reset value: 0x00000000
256 BEGIN_TYPE(SER_t, uint32_t)
257 // For each bit:
258 // 0 -> slave not selected
259 // 1 -> slave selected
260 ADD_BITFIELD_RW(SER, 0, 1)
261 END_TYPE()
262
263 // Baud rate
264 // Reset value: 0x00000000
265 BEGIN_TYPE(BAUDR_t, uint32_t)
266 // SSI clock divider
267 ADD_BITFIELD_RW(SCKDV, 0, 16)
268 END_TYPE()
269
270 // TX FIFO threshold level
271 // Reset value: 0x00000000
272 BEGIN_TYPE(TXFTLR_t, uint32_t)
273 // Transmit FIFO threshold
274 ADD_BITFIELD_RW(TFT, 0, 8)
275 END_TYPE()
276
277 // RX FIFO threshold level
278 // Reset value: 0x00000000
279 BEGIN_TYPE(RXFTLR_t, uint32_t)
280 // Receive FIFO threshold
281 ADD_BITFIELD_RW(RFT, 0, 8)
282 END_TYPE()
283
284 // TX FIFO level
285 // Reset value: 0x00000000
286 BEGIN_TYPE(TXFLR_t, uint32_t)
287 // Transmit FIFO level
288 ADD_BITFIELD_RO(TFTFL, 0, 8)
289 END_TYPE()
290
291 // RX FIFO level
292 // Reset value: 0x00000000
293 BEGIN_TYPE(RXFLR_t, uint32_t)
294 // Receive FIFO level
295 ADD_BITFIELD_RO(RXTFL, 0, 8)
296 END_TYPE()
297
298 // Status register
299 // Reset value: 0x00000000
300 BEGIN_TYPE(SR_t, uint32_t)
301 // Data collision error
302 ADD_BITFIELD_RO(DCOL, 6, 1)
303 // Transmission error
304 ADD_BITFIELD_RO(TXE, 5, 1)
305 // Receive FIFO full
306 ADD_BITFIELD_RO(RFF, 4, 1)
307 // Receive FIFO not empty
308 ADD_BITFIELD_RO(RFNE, 3, 1)
309 // Transmit FIFO empty
310 ADD_BITFIELD_RO(TFE, 2, 1)
311 // Transmit FIFO not full
312 ADD_BITFIELD_RO(TFNF, 1, 1)
313 // SSI busy flag
314 ADD_BITFIELD_RO(BUSY, 0, 1)
315 END_TYPE()
316
317 // Interrupt mask
318 // Reset value: 0x00000000
319 BEGIN_TYPE(IMR_t, uint32_t)
320 // Multi-master contention interrupt mask
321 ADD_BITFIELD_RW(MSTIM, 5, 1)
322 // Receive FIFO full interrupt mask
323 ADD_BITFIELD_RW(RXFIM, 4, 1)
324 // Receive FIFO overflow interrupt mask
325 ADD_BITFIELD_RW(RXOIM, 3, 1)
326 // Receive FIFO underflow interrupt mask
327 ADD_BITFIELD_RW(RXUIM, 2, 1)
328 // Transmit FIFO overflow interrupt mask
329 ADD_BITFIELD_RW(TXOIM, 1, 1)
330 // Transmit FIFO empty interrupt mask
331 ADD_BITFIELD_RW(TXEIM, 0, 1)
332 END_TYPE()
333
334 // Interrupt status
335 // Reset value: 0x00000000
336 BEGIN_TYPE(ISR_t, uint32_t)
337 // Multi-master contention interrupt status
338 ADD_BITFIELD_RO(MSTIS, 5, 1)
339 // Receive FIFO full interrupt status
340 ADD_BITFIELD_RO(RXFIS, 4, 1)
341 // Receive FIFO overflow interrupt status
342 ADD_BITFIELD_RO(RXOIS, 3, 1)
343 // Receive FIFO underflow interrupt status
344 ADD_BITFIELD_RO(RXUIS, 2, 1)
345 // Transmit FIFO overflow interrupt status
346 ADD_BITFIELD_RO(TXOIS, 1, 1)
347 // Transmit FIFO empty interrupt status
348 ADD_BITFIELD_RO(TXEIS, 0, 1)
349 END_TYPE()
350
351 // Raw interrupt status
352 // Reset value: 0x00000000
353 BEGIN_TYPE(RISR_t, uint32_t)
354 // Multi-master contention raw interrupt status
355 ADD_BITFIELD_RO(MSTIR, 5, 1)
356 // Receive FIFO full raw interrupt status
357 ADD_BITFIELD_RO(RXFIR, 4, 1)
358 // Receive FIFO overflow raw interrupt status
359 ADD_BITFIELD_RO(RXOIR, 3, 1)
360 // Receive FIFO underflow raw interrupt status
361 ADD_BITFIELD_RO(RXUIR, 2, 1)
362 // Transmit FIFO overflow raw interrupt status
363 ADD_BITFIELD_RO(TXOIR, 1, 1)
364 // Transmit FIFO empty raw interrupt status
365 ADD_BITFIELD_RO(TXEIR, 0, 1)
366 END_TYPE()
367
368 // TX FIFO overflow interrupt clear
369 // Reset value: 0x00000000
370 BEGIN_TYPE(TXOICR_t, uint32_t)
371 // Clear-on-read transmit FIFO overflow interrupt
372 ADD_BITFIELD_RO(TXOICR, 0, 1)
373 END_TYPE()
374
375 // RX FIFO overflow interrupt clear
376 // Reset value: 0x00000000
377 BEGIN_TYPE(RXOICR_t, uint32_t)
378 // Clear-on-read receive FIFO overflow interrupt
379 ADD_BITFIELD_RO(RXOICR, 0, 1)
380 END_TYPE()
381
382 // RX FIFO underflow interrupt clear
383 // Reset value: 0x00000000
384 BEGIN_TYPE(RXUICR_t, uint32_t)
385 // Clear-on-read receive FIFO underflow interrupt
386 ADD_BITFIELD_RO(RXUICR, 0, 1)
387 END_TYPE()
388
389 // Multi-master interrupt clear
390 // Reset value: 0x00000000
391 BEGIN_TYPE(MSTICR_t, uint32_t)
392 // Clear-on-read multi-master contention interrupt
393 ADD_BITFIELD_RO(MSTICR, 0, 1)
394 END_TYPE()
395
396 // Interrupt clear
397 // Reset value: 0x00000000
398 BEGIN_TYPE(ICR_t, uint32_t)
399 // Clear-on-read all active interrupts
400 ADD_BITFIELD_RO(ICR, 0, 1)
401 END_TYPE()
402
403 // DMA control
404 // Reset value: 0x00000000
405 BEGIN_TYPE(DMACR_t, uint32_t)
406 // Transmit DMA enable
407 ADD_BITFIELD_RW(TDMAE, 1, 1)
408 // Receive DMA enable
409 ADD_BITFIELD_RW(RDMAE, 0, 1)
410 END_TYPE()
411
412 // DMA TX data level
413 // Reset value: 0x00000000
414 BEGIN_TYPE(DMATDLR_t, uint32_t)
415 // Transmit data watermark level
416 ADD_BITFIELD_RW(DMATDL, 0, 8)
417 END_TYPE()
418
419 // DMA RX data level
420 // Reset value: 0x00000000
421 BEGIN_TYPE(DMARDLR_t, uint32_t)
422 // Receive data watermark level (DMARDLR+1)
423 ADD_BITFIELD_RW(DMARDL, 0, 8)
424 END_TYPE()
425
426 // Identification register
427 // Reset value: 0x51535049
428 BEGIN_TYPE(IDR_t, uint32_t)
429 // Peripheral dentification code
430 ADD_BITFIELD_RO(IDCODE, 0, 32)
431 END_TYPE()
432
433 // Version ID
434 // Reset value: 0x3430312a
435 BEGIN_TYPE(SSI_VERSION_ID_t, uint32_t)
436 // SNPS component version (format X.YY)
437 ADD_BITFIELD_RO(SSI_COMP_VERSION, 0, 32)
438 END_TYPE()
439
440 // Data Register 0 (of 36)
441 // Reset value: 0x00000000
442 BEGIN_TYPE(DR0_t, uint32_t)
443 // First data register of 36
444 ADD_BITFIELD_RW(DR, 0, 32)
445 END_TYPE()
446
447 // RX sample delay
448 // Reset value: 0x00000000
449 BEGIN_TYPE(RX_SAMPLE_DLY_t, uint32_t)
450 // RXD sample delay (in SCLK cycles)
451 ADD_BITFIELD_RW(RSD, 0, 8)
452 END_TYPE()
453
454 // SPI control
455 // Reset value: 0x03000000
456 BEGIN_TYPE(SPI_CTRLR0_t, uint32_t)
457 // SPI Command to send in XIP mode (INST_L = 8-bit) or to append to Address (INST_L = 0-bit)
458 ADD_BITFIELD_RW(XIP_CMD, 24, 8)
459 // Read data strobe enable
460 ADD_BITFIELD_RW(SPI_RXDS_EN, 18, 1)
461 // Instruction DDR transfer enable
462 ADD_BITFIELD_RW(INST_DDR_EN, 17, 1)
463 // SPI DDR transfer enable
464 ADD_BITFIELD_RW(SPI_DDR_EN, 16, 1)
465 // Wait cycles between control frame transmit and data reception (in SCLK cycles)
466 ADD_BITFIELD_RW(WAIT_CYCLES, 11, 5)
467 // Instruction length (0/4/8/16b)
468 ADD_BITFIELD_RW(INST_L, 8, 2)
469 // Address length (0b-60b in 4b increments)
470 ADD_BITFIELD_RW(ADDR_L, 2, 4)
471 // Address and instruction transfer format
472 ADD_BITFIELD_RW(TRANS_TYPE, 0, 2)
473 END_TYPE()
474
475 // No instruction
476 static const uint32_t SPI_CTRLR0_INST_L__NONE = 0;
477 // 4-bit instruction
478 static const uint32_t SPI_CTRLR0_INST_L__4B = 1;
479 // 8-bit instruction
480 static const uint32_t SPI_CTRLR0_INST_L__8B = 2;
481 // 16-bit instruction
482 static const uint32_t SPI_CTRLR0_INST_L__16B = 3;
483 // Command and address both in standard SPI frame format
484 static const uint32_t SPI_CTRLR0_TRANS_TYPE__1C1A = 0;
485 // Command in standard SPI format, address in format specified by FRF
486 static const uint32_t SPI_CTRLR0_TRANS_TYPE__1C2A = 1;
487 // Command and address both in format specified by FRF (e.g. Dual-SPI)
488 static const uint32_t SPI_CTRLR0_TRANS_TYPE__2C2A = 2;
489
490 // TX drive edge
491 // Reset value: 0x00000000
492 BEGIN_TYPE(TXD_DRIVE_EDGE_t, uint32_t)
493 // TXD drive edge
494 ADD_BITFIELD_RW(TDE, 0, 8)
495 END_TYPE()
496
497 struct XIP_SSI_t {
498 CTRLR0_t CTRLR0;
499 CTRLR1_t CTRLR1;
500 SSIENR_t SSIENR;
501 MWCR_t MWCR;
502 SER_t SER;
503 BAUDR_t BAUDR;
504 TXFTLR_t TXFTLR;
505 RXFTLR_t RXFTLR;
506 TXFLR_t TXFLR;
507 RXFLR_t RXFLR;
508 SR_t SR;
509 IMR_t IMR;
510 ISR_t ISR;
511 RISR_t RISR;
512 TXOICR_t TXOICR;
513 RXOICR_t RXOICR;
514 RXUICR_t RXUICR;
515 MSTICR_t MSTICR;
516 ICR_t ICR;
517 DMACR_t DMACR;
518 DMATDLR_t DMATDLR;
519 DMARDLR_t DMARDLR;
520 IDR_t IDR;
521 SSI_VERSION_ID_t SSI_VERSION_ID;
522 DR0_t DR0;
523 uint32_t reserved0[35];
524 RX_SAMPLE_DLY_t RX_SAMPLE_DLY;
525 SPI_CTRLR0_t SPI_CTRLR0;
526 TXD_DRIVE_EDGE_t TXD_DRIVE_EDGE;
527 };
528
529 static XIP_SSI_t & XIP_SSI = (*(XIP_SSI_t *)0x18000000);
530 static XIP_SSI_t & XIP_SSI_XOR = (*(XIP_SSI_t *)0x18001000);
531 static XIP_SSI_t & XIP_SSI_SET = (*(XIP_SSI_t *)0x18002000);
532 static XIP_SSI_t & XIP_SSI_CLR = (*(XIP_SSI_t *)0x18003000);
533
534} // _XIP_SSI_
535
536namespace _SYSINFO_ {
537
538 // JEDEC JEP-106 compliant chip identifier.
539 // Reset value: 0x00000000
540 BEGIN_TYPE(CHIP_ID_t, uint32_t)
541 ADD_BITFIELD_RO(REVISION, 28, 4)
542 ADD_BITFIELD_RO(PART, 12, 16)
543 ADD_BITFIELD_RO(MANUFACTURER, 0, 12)
544 END_TYPE()
545
546 // Platform register. Allows software to know what environment it is running in.
547 // Reset value: 0x00000000
548 BEGIN_TYPE(PLATFORM_t, uint32_t)
549 ADD_BITFIELD_RO(ASIC, 1, 1)
550 ADD_BITFIELD_RO(FPGA, 0, 1)
551 END_TYPE()
552
553 // Git hash of the chip source. Used to identify chip version.
554 // Reset value: 0x00000000
555 typedef uint32_t GITREF_RP2040_t;
556
557 struct SYSINFO_t {
558 CHIP_ID_t CHIP_ID;
559 PLATFORM_t PLATFORM;
560 uint32_t reserved0[14];
561 GITREF_RP2040_t GITREF_RP2040;
562 };
563
564 static SYSINFO_t & SYSINFO = (*(SYSINFO_t *)0x40000000);
565 static SYSINFO_t & SYSINFO_XOR = (*(SYSINFO_t *)0x40001000);
566 static SYSINFO_t & SYSINFO_SET = (*(SYSINFO_t *)0x40002000);
567 static SYSINFO_t & SYSINFO_CLR = (*(SYSINFO_t *)0x40003000);
568
569} // _SYSINFO_
570
571// Register block for various chip control signals
572namespace _SYSCFG_ {
573
574 // Processor core 0 NMI source mask
575 // Set a bit high to enable NMI from that IRQ
576 // Reset value: 0x00000000
577 typedef uint32_t PROC0_NMI_MASK_t;
578
579 // Processor core 1 NMI source mask
580 // Set a bit high to enable NMI from that IRQ
581 // Reset value: 0x00000000
582 typedef uint32_t PROC1_NMI_MASK_t;
583
584 // Configuration for processors
585 // Reset value: 0x10000000
586 BEGIN_TYPE(PROC_CONFIG_t, uint32_t)
587 // Configure proc1 DAP instance ID.
588 // Recommend that this is NOT changed until you require debug access in multi-chip environment
589 // WARNING: do not set to 15 as this is reserved for RescueDP
590 ADD_BITFIELD_RW(PROC1_DAP_INSTID, 28, 4)
591 // Configure proc0 DAP instance ID.
592 // Recommend that this is NOT changed until you require debug access in multi-chip environment
593 // WARNING: do not set to 15 as this is reserved for RescueDP
594 ADD_BITFIELD_RW(PROC0_DAP_INSTID, 24, 4)
595 // Indication that proc1 has halted
596 ADD_BITFIELD_RO(PROC1_HALTED, 1, 1)
597 // Indication that proc0 has halted
598 ADD_BITFIELD_RO(PROC0_HALTED, 0, 1)
599 END_TYPE()
600
601 // For each bit, if 1, bypass the input synchronizer between that GPIO
602 // and the GPIO input register in the SIO. The input synchronizers should
603 // generally be unbypassed, to avoid injecting metastabilities into processors.
604 // If you're feeling brave, you can bypass to save two cycles of input
605 // latency. This register applies to GPIO 0...29.
606 // Reset value: 0x00000000
607 BEGIN_TYPE(PROC_IN_SYNC_BYPASS_t, uint32_t)
608 ADD_BITFIELD_RW(PROC_IN_SYNC_BYPASS, 0, 30)
609 END_TYPE()
610
611 // For each bit, if 1, bypass the input synchronizer between that GPIO
612 // and the GPIO input register in the SIO. The input synchronizers should
613 // generally be unbypassed, to avoid injecting metastabilities into processors.
614 // If you're feeling brave, you can bypass to save two cycles of input
615 // latency. This register applies to GPIO 30...35 (the QSPI IOs).
616 // Reset value: 0x00000000
617 BEGIN_TYPE(PROC_IN_SYNC_BYPASS_HI_t, uint32_t)
618 ADD_BITFIELD_RW(PROC_IN_SYNC_BYPASS_HI, 0, 6)
619 END_TYPE()
620
621 // Directly control the SWD debug port of either processor
622 // Reset value: 0x00000066
623 BEGIN_TYPE(DBGFORCE_t, uint32_t)
624 // Attach processor 1 debug port to syscfg controls, and disconnect it from external SWD pads.
625 ADD_BITFIELD_RW(PROC1_ATTACH, 7, 1)
626 // Directly drive processor 1 SWCLK, if PROC1_ATTACH is set
627 ADD_BITFIELD_RW(PROC1_SWCLK, 6, 1)
628 // Directly drive processor 1 SWDIO input, if PROC1_ATTACH is set
629 ADD_BITFIELD_RW(PROC1_SWDI, 5, 1)
630 // Observe the value of processor 1 SWDIO output.
631 ADD_BITFIELD_RO(PROC1_SWDO, 4, 1)
632 // Attach processor 0 debug port to syscfg controls, and disconnect it from external SWD pads.
633 ADD_BITFIELD_RW(PROC0_ATTACH, 3, 1)
634 // Directly drive processor 0 SWCLK, if PROC0_ATTACH is set
635 ADD_BITFIELD_RW(PROC0_SWCLK, 2, 1)
636 // Directly drive processor 0 SWDIO input, if PROC0_ATTACH is set
637 ADD_BITFIELD_RW(PROC0_SWDI, 1, 1)
638 // Observe the value of processor 0 SWDIO output.
639 ADD_BITFIELD_RO(PROC0_SWDO, 0, 1)
640 END_TYPE()
641
642 // Control power downs to memories. Set high to power down memories.
643 // Use with extreme caution
644 // Reset value: 0x00000000
645 BEGIN_TYPE(MEMPOWERDOWN_t, uint32_t)
646 ADD_BITFIELD_RW(ROM, 7, 1)
647 ADD_BITFIELD_RW(USB, 6, 1)
648 ADD_BITFIELD_RW(SRAM5, 5, 1)
649 ADD_BITFIELD_RW(SRAM4, 4, 1)
650 ADD_BITFIELD_RW(SRAM3, 3, 1)
651 ADD_BITFIELD_RW(SRAM2, 2, 1)
652 ADD_BITFIELD_RW(SRAM1, 1, 1)
653 ADD_BITFIELD_RW(SRAM0, 0, 1)
654 END_TYPE()
655
656 struct SYSCFG_t {
657 PROC0_NMI_MASK_t PROC0_NMI_MASK;
658 PROC1_NMI_MASK_t PROC1_NMI_MASK;
659 PROC_CONFIG_t PROC_CONFIG;
660 PROC_IN_SYNC_BYPASS_t PROC_IN_SYNC_BYPASS;
661 PROC_IN_SYNC_BYPASS_HI_t PROC_IN_SYNC_BYPASS_HI;
662 DBGFORCE_t DBGFORCE;
663 MEMPOWERDOWN_t MEMPOWERDOWN;
664 };
665
666 static SYSCFG_t & SYSCFG = (*(SYSCFG_t *)0x40004000);
667 static SYSCFG_t & SYSCFG_XOR = (*(SYSCFG_t *)0x40005000);
668 static SYSCFG_t & SYSCFG_SET = (*(SYSCFG_t *)0x40006000);
669 static SYSCFG_t & SYSCFG_CLR = (*(SYSCFG_t *)0x40007000);
670
671} // _SYSCFG_
672
673namespace _CLOCKS_ {
674
675 // Clock control, can be changed on-the-fly (except for auxsrc)
676 // Reset value: 0x00000000
677 BEGIN_TYPE(CLK_GPOUT0_CTRL_t, uint32_t)
678 // An edge on this signal shifts the phase of the output by 1 cycle of the input clock
679 // This can be done at any time
680 ADD_BITFIELD_RW(NUDGE, 20, 1)
681 // This delays the enable signal by up to 3 cycles of the input clock
682 // This must be set before the clock is enabled to have any effect
683 ADD_BITFIELD_RW(PHASE, 16, 2)
684 // Enables duty cycle correction for odd divisors
685 ADD_BITFIELD_RW(DC50, 12, 1)
686 // Starts and stops the clock generator cleanly
687 ADD_BITFIELD_RW(ENABLE, 11, 1)
688 // Asynchronously kills the clock generator
689 ADD_BITFIELD_RW(KILL, 10, 1)
690 // Selects the auxiliary clock source, will glitch when switching
691 ADD_BITFIELD_RW(AUXSRC, 5, 4)
692 END_TYPE()
693
694 static const uint32_t CLK_GPOUT0_CTRL_AUXSRC__clksrc_pll_sys = 0;
695 static const uint32_t CLK_GPOUT0_CTRL_AUXSRC__clksrc_gpin0 = 1;
696 static const uint32_t CLK_GPOUT0_CTRL_AUXSRC__clksrc_gpin1 = 2;
697 static const uint32_t CLK_GPOUT0_CTRL_AUXSRC__clksrc_pll_usb = 3;
698 static const uint32_t CLK_GPOUT0_CTRL_AUXSRC__rosc_clksrc = 4;
699 static const uint32_t CLK_GPOUT0_CTRL_AUXSRC__xosc_clksrc = 5;
700 static const uint32_t CLK_GPOUT0_CTRL_AUXSRC__clk_sys = 6;
701 static const uint32_t CLK_GPOUT0_CTRL_AUXSRC__clk_usb = 7;
702 static const uint32_t CLK_GPOUT0_CTRL_AUXSRC__clk_adc = 8;
703 static const uint32_t CLK_GPOUT0_CTRL_AUXSRC__clk_rtc = 9;
704 static const uint32_t CLK_GPOUT0_CTRL_AUXSRC__clk_ref = 10;
705
706 // Clock divisor, can be changed on-the-fly
707 // Reset value: 0x00000100
708 BEGIN_TYPE(CLK_GPOUT0_DIV_t, uint32_t)
709 // Integer component of the divisor, 0 -> divide by 2^16
710 ADD_BITFIELD_RW(INT, 8, 24)
711 // Fractional component of the divisor
712 ADD_BITFIELD_RW(FRAC, 0, 8)
713 END_TYPE()
714
715 // Indicates which SRC is currently selected by the glitchless mux (one-hot).
716 // This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.
717 // Reset value: 0x00000001
718 typedef uint32_t CLK_GPOUT0_SELECTED_t;
719
720 // Clock control, can be changed on-the-fly (except for auxsrc)
721 // Reset value: 0x00000000
722 BEGIN_TYPE(CLK_GPOUT1_CTRL_t, uint32_t)
723 // An edge on this signal shifts the phase of the output by 1 cycle of the input clock
724 // This can be done at any time
725 ADD_BITFIELD_RW(NUDGE, 20, 1)
726 // This delays the enable signal by up to 3 cycles of the input clock
727 // This must be set before the clock is enabled to have any effect
728 ADD_BITFIELD_RW(PHASE, 16, 2)
729 // Enables duty cycle correction for odd divisors
730 ADD_BITFIELD_RW(DC50, 12, 1)
731 // Starts and stops the clock generator cleanly
732 ADD_BITFIELD_RW(ENABLE, 11, 1)
733 // Asynchronously kills the clock generator
734 ADD_BITFIELD_RW(KILL, 10, 1)
735 // Selects the auxiliary clock source, will glitch when switching
736 ADD_BITFIELD_RW(AUXSRC, 5, 4)
737 END_TYPE()
738
739 static const uint32_t CLK_GPOUT1_CTRL_AUXSRC__clksrc_pll_sys = 0;
740 static const uint32_t CLK_GPOUT1_CTRL_AUXSRC__clksrc_gpin0 = 1;
741 static const uint32_t CLK_GPOUT1_CTRL_AUXSRC__clksrc_gpin1 = 2;
742 static const uint32_t CLK_GPOUT1_CTRL_AUXSRC__clksrc_pll_usb = 3;
743 static const uint32_t CLK_GPOUT1_CTRL_AUXSRC__rosc_clksrc = 4;
744 static const uint32_t CLK_GPOUT1_CTRL_AUXSRC__xosc_clksrc = 5;
745 static const uint32_t CLK_GPOUT1_CTRL_AUXSRC__clk_sys = 6;
746 static const uint32_t CLK_GPOUT1_CTRL_AUXSRC__clk_usb = 7;
747 static const uint32_t CLK_GPOUT1_CTRL_AUXSRC__clk_adc = 8;
748 static const uint32_t CLK_GPOUT1_CTRL_AUXSRC__clk_rtc = 9;
749 static const uint32_t CLK_GPOUT1_CTRL_AUXSRC__clk_ref = 10;
750
751 // Clock divisor, can be changed on-the-fly
752 // Reset value: 0x00000100
753 BEGIN_TYPE(CLK_GPOUT1_DIV_t, uint32_t)
754 // Integer component of the divisor, 0 -> divide by 2^16
755 ADD_BITFIELD_RW(INT, 8, 24)
756 // Fractional component of the divisor
757 ADD_BITFIELD_RW(FRAC, 0, 8)
758 END_TYPE()
759
760 // Indicates which SRC is currently selected by the glitchless mux (one-hot).
761 // This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.
762 // Reset value: 0x00000001
763 typedef uint32_t CLK_GPOUT1_SELECTED_t;
764
765 // Clock control, can be changed on-the-fly (except for auxsrc)
766 // Reset value: 0x00000000
767 BEGIN_TYPE(CLK_GPOUT2_CTRL_t, uint32_t)
768 // An edge on this signal shifts the phase of the output by 1 cycle of the input clock
769 // This can be done at any time
770 ADD_BITFIELD_RW(NUDGE, 20, 1)
771 // This delays the enable signal by up to 3 cycles of the input clock
772 // This must be set before the clock is enabled to have any effect
773 ADD_BITFIELD_RW(PHASE, 16, 2)
774 // Enables duty cycle correction for odd divisors
775 ADD_BITFIELD_RW(DC50, 12, 1)
776 // Starts and stops the clock generator cleanly
777 ADD_BITFIELD_RW(ENABLE, 11, 1)
778 // Asynchronously kills the clock generator
779 ADD_BITFIELD_RW(KILL, 10, 1)
780 // Selects the auxiliary clock source, will glitch when switching
781 ADD_BITFIELD_RW(AUXSRC, 5, 4)
782 END_TYPE()
783
784 static const uint32_t CLK_GPOUT2_CTRL_AUXSRC__clksrc_pll_sys = 0;
785 static const uint32_t CLK_GPOUT2_CTRL_AUXSRC__clksrc_gpin0 = 1;
786 static const uint32_t CLK_GPOUT2_CTRL_AUXSRC__clksrc_gpin1 = 2;
787 static const uint32_t CLK_GPOUT2_CTRL_AUXSRC__clksrc_pll_usb = 3;
788 static const uint32_t CLK_GPOUT2_CTRL_AUXSRC__rosc_clksrc_ph = 4;
789 static const uint32_t CLK_GPOUT2_CTRL_AUXSRC__xosc_clksrc = 5;
790 static const uint32_t CLK_GPOUT2_CTRL_AUXSRC__clk_sys = 6;
791 static const uint32_t CLK_GPOUT2_CTRL_AUXSRC__clk_usb = 7;
792 static const uint32_t CLK_GPOUT2_CTRL_AUXSRC__clk_adc = 8;
793 static const uint32_t CLK_GPOUT2_CTRL_AUXSRC__clk_rtc = 9;
794 static const uint32_t CLK_GPOUT2_CTRL_AUXSRC__clk_ref = 10;
795
796 // Clock divisor, can be changed on-the-fly
797 // Reset value: 0x00000100
798 BEGIN_TYPE(CLK_GPOUT2_DIV_t, uint32_t)
799 // Integer component of the divisor, 0 -> divide by 2^16
800 ADD_BITFIELD_RW(INT, 8, 24)
801 // Fractional component of the divisor
802 ADD_BITFIELD_RW(FRAC, 0, 8)
803 END_TYPE()
804
805 // Indicates which SRC is currently selected by the glitchless mux (one-hot).
806 // This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.
807 // Reset value: 0x00000001
808 typedef uint32_t CLK_GPOUT2_SELECTED_t;
809
810 // Clock control, can be changed on-the-fly (except for auxsrc)
811 // Reset value: 0x00000000
812 BEGIN_TYPE(CLK_GPOUT3_CTRL_t, uint32_t)
813 // An edge on this signal shifts the phase of the output by 1 cycle of the input clock
814 // This can be done at any time
815 ADD_BITFIELD_RW(NUDGE, 20, 1)
816 // This delays the enable signal by up to 3 cycles of the input clock
817 // This must be set before the clock is enabled to have any effect
818 ADD_BITFIELD_RW(PHASE, 16, 2)
819 // Enables duty cycle correction for odd divisors
820 ADD_BITFIELD_RW(DC50, 12, 1)
821 // Starts and stops the clock generator cleanly
822 ADD_BITFIELD_RW(ENABLE, 11, 1)
823 // Asynchronously kills the clock generator
824 ADD_BITFIELD_RW(KILL, 10, 1)
825 // Selects the auxiliary clock source, will glitch when switching
826 ADD_BITFIELD_RW(AUXSRC, 5, 4)
827 END_TYPE()
828
829 static const uint32_t CLK_GPOUT3_CTRL_AUXSRC__clksrc_pll_sys = 0;
830 static const uint32_t CLK_GPOUT3_CTRL_AUXSRC__clksrc_gpin0 = 1;
831 static const uint32_t CLK_GPOUT3_CTRL_AUXSRC__clksrc_gpin1 = 2;
832 static const uint32_t CLK_GPOUT3_CTRL_AUXSRC__clksrc_pll_usb = 3;
833 static const uint32_t CLK_GPOUT3_CTRL_AUXSRC__rosc_clksrc_ph = 4;
834 static const uint32_t CLK_GPOUT3_CTRL_AUXSRC__xosc_clksrc = 5;
835 static const uint32_t CLK_GPOUT3_CTRL_AUXSRC__clk_sys = 6;
836 static const uint32_t CLK_GPOUT3_CTRL_AUXSRC__clk_usb = 7;
837 static const uint32_t CLK_GPOUT3_CTRL_AUXSRC__clk_adc = 8;
838 static const uint32_t CLK_GPOUT3_CTRL_AUXSRC__clk_rtc = 9;
839 static const uint32_t CLK_GPOUT3_CTRL_AUXSRC__clk_ref = 10;
840
841 // Clock divisor, can be changed on-the-fly
842 // Reset value: 0x00000100
843 BEGIN_TYPE(CLK_GPOUT3_DIV_t, uint32_t)
844 // Integer component of the divisor, 0 -> divide by 2^16
845 ADD_BITFIELD_RW(INT, 8, 24)
846 // Fractional component of the divisor
847 ADD_BITFIELD_RW(FRAC, 0, 8)
848 END_TYPE()
849
850 // Indicates which SRC is currently selected by the glitchless mux (one-hot).
851 // This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.
852 // Reset value: 0x00000001
853 typedef uint32_t CLK_GPOUT3_SELECTED_t;
854
855 // Clock control, can be changed on-the-fly (except for auxsrc)
856 // Reset value: 0x00000000
857 BEGIN_TYPE(CLK_REF_CTRL_t, uint32_t)
858 // Selects the auxiliary clock source, will glitch when switching
859 ADD_BITFIELD_RW(AUXSRC, 5, 2)
860 // Selects the clock source glitchlessly, can be changed on-the-fly
861 ADD_BITFIELD_RW(SRC, 0, 2)
862 END_TYPE()
863
864 static const uint32_t CLK_REF_CTRL_AUXSRC__clksrc_pll_usb = 0;
865 static const uint32_t CLK_REF_CTRL_AUXSRC__clksrc_gpin0 = 1;
866 static const uint32_t CLK_REF_CTRL_AUXSRC__clksrc_gpin1 = 2;
867 static const uint32_t CLK_REF_CTRL_SRC__rosc_clksrc_ph = 0;
868 static const uint32_t CLK_REF_CTRL_SRC__clksrc_clk_ref_aux = 1;
869 static const uint32_t CLK_REF_CTRL_SRC__xosc_clksrc = 2;
870
871 // Clock divisor, can be changed on-the-fly
872 // Reset value: 0x00000100
873 BEGIN_TYPE(CLK_REF_DIV_t, uint32_t)
874 // Integer component of the divisor, 0 -> divide by 2^16
875 ADD_BITFIELD_RW(INT, 8, 2)
876 END_TYPE()
877
878 // Indicates which SRC is currently selected by the glitchless mux (one-hot).
879 // The glitchless multiplexer does not switch instantaneously (to avoid glitches), so software should poll this register to wait for the switch to complete. This register contains one decoded bit for each of the clock sources enumerated in the CTRL SRC field. At most one of these bits will be set at any time, indicating that clock is currently present at the output of the glitchless mux. Whilst switching is in progress, this register may briefly show all-0s.
880 // Reset value: 0x00000001
881 typedef uint32_t CLK_REF_SELECTED_t;
882
883 // Clock control, can be changed on-the-fly (except for auxsrc)
884 // Reset value: 0x00000000
885 BEGIN_TYPE(CLK_SYS_CTRL_t, uint32_t)
886 // Selects the auxiliary clock source, will glitch when switching
887 ADD_BITFIELD_RW(AUXSRC, 5, 3)
888 // Selects the clock source glitchlessly, can be changed on-the-fly
889 ADD_BITFIELD_RW(SRC, 0, 1)
890 END_TYPE()
891
892 static const uint32_t CLK_SYS_CTRL_AUXSRC__clksrc_pll_sys = 0;
893 static const uint32_t CLK_SYS_CTRL_AUXSRC__clksrc_pll_usb = 1;
894 static const uint32_t CLK_SYS_CTRL_AUXSRC__rosc_clksrc = 2;
895 static const uint32_t CLK_SYS_CTRL_AUXSRC__xosc_clksrc = 3;
896 static const uint32_t CLK_SYS_CTRL_AUXSRC__clksrc_gpin0 = 4;
897 static const uint32_t CLK_SYS_CTRL_AUXSRC__clksrc_gpin1 = 5;
898 static const uint32_t CLK_SYS_CTRL_SRC__clk_ref = 0;
899 static const uint32_t CLK_SYS_CTRL_SRC__clksrc_clk_sys_aux = 1;
900
901 // Clock divisor, can be changed on-the-fly
902 // Reset value: 0x00000100
903 BEGIN_TYPE(CLK_SYS_DIV_t, uint32_t)
904 // Integer component of the divisor, 0 -> divide by 2^16
905 ADD_BITFIELD_RW(INT, 8, 24)
906 // Fractional component of the divisor
907 ADD_BITFIELD_RW(FRAC, 0, 8)
908 END_TYPE()
909
910 // Indicates which SRC is currently selected by the glitchless mux (one-hot).
911 // The glitchless multiplexer does not switch instantaneously (to avoid glitches), so software should poll this register to wait for the switch to complete. This register contains one decoded bit for each of the clock sources enumerated in the CTRL SRC field. At most one of these bits will be set at any time, indicating that clock is currently present at the output of the glitchless mux. Whilst switching is in progress, this register may briefly show all-0s.
912 // Reset value: 0x00000001
913 typedef uint32_t CLK_SYS_SELECTED_t;
914
915 // Clock control, can be changed on-the-fly (except for auxsrc)
916 // Reset value: 0x00000000
917 BEGIN_TYPE(CLK_PERI_CTRL_t, uint32_t)
918 // Starts and stops the clock generator cleanly
919 ADD_BITFIELD_RW(ENABLE, 11, 1)
920 // Asynchronously kills the clock generator
921 ADD_BITFIELD_RW(KILL, 10, 1)
922 // Selects the auxiliary clock source, will glitch when switching
923 ADD_BITFIELD_RW(AUXSRC, 5, 3)
924 END_TYPE()
925
926 static const uint32_t CLK_PERI_CTRL_AUXSRC__clk_sys = 0;
927 static const uint32_t CLK_PERI_CTRL_AUXSRC__clksrc_pll_sys = 1;
928 static const uint32_t CLK_PERI_CTRL_AUXSRC__clksrc_pll_usb = 2;
929 static const uint32_t CLK_PERI_CTRL_AUXSRC__rosc_clksrc_ph = 3;
930 static const uint32_t CLK_PERI_CTRL_AUXSRC__xosc_clksrc = 4;
931 static const uint32_t CLK_PERI_CTRL_AUXSRC__clksrc_gpin0 = 5;
932 static const uint32_t CLK_PERI_CTRL_AUXSRC__clksrc_gpin1 = 6;
933
934 // Indicates which SRC is currently selected by the glitchless mux (one-hot).
935 // This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.
936 // Reset value: 0x00000001
937 typedef uint32_t CLK_PERI_SELECTED_t;
938
939 // Clock control, can be changed on-the-fly (except for auxsrc)
940 // Reset value: 0x00000000
941 BEGIN_TYPE(CLK_USB_CTRL_t, uint32_t)
942 // An edge on this signal shifts the phase of the output by 1 cycle of the input clock
943 // This can be done at any time
944 ADD_BITFIELD_RW(NUDGE, 20, 1)
945 // This delays the enable signal by up to 3 cycles of the input clock
946 // This must be set before the clock is enabled to have any effect
947 ADD_BITFIELD_RW(PHASE, 16, 2)
948 // Starts and stops the clock generator cleanly
949 ADD_BITFIELD_RW(ENABLE, 11, 1)
950 // Asynchronously kills the clock generator
951 ADD_BITFIELD_RW(KILL, 10, 1)
952 // Selects the auxiliary clock source, will glitch when switching
953 ADD_BITFIELD_RW(AUXSRC, 5, 3)
954 END_TYPE()
955
956 static const uint32_t CLK_USB_CTRL_AUXSRC__clksrc_pll_usb = 0;
957 static const uint32_t CLK_USB_CTRL_AUXSRC__clksrc_pll_sys = 1;
958 static const uint32_t CLK_USB_CTRL_AUXSRC__rosc_clksrc_ph = 2;
959 static const uint32_t CLK_USB_CTRL_AUXSRC__xosc_clksrc = 3;
960 static const uint32_t CLK_USB_CTRL_AUXSRC__clksrc_gpin0 = 4;
961 static const uint32_t CLK_USB_CTRL_AUXSRC__clksrc_gpin1 = 5;
962
963 // Clock divisor, can be changed on-the-fly
964 // Reset value: 0x00000100
965 BEGIN_TYPE(CLK_USB_DIV_t, uint32_t)
966 // Integer component of the divisor, 0 -> divide by 2^16
967 ADD_BITFIELD_RW(INT, 8, 2)
968 END_TYPE()
969
970 // Indicates which SRC is currently selected by the glitchless mux (one-hot).
971 // This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.
972 // Reset value: 0x00000001
973 typedef uint32_t CLK_USB_SELECTED_t;
974
975 // Clock control, can be changed on-the-fly (except for auxsrc)
976 // Reset value: 0x00000000
977 BEGIN_TYPE(CLK_ADC_CTRL_t, uint32_t)
978 // An edge on this signal shifts the phase of the output by 1 cycle of the input clock
979 // This can be done at any time
980 ADD_BITFIELD_RW(NUDGE, 20, 1)
981 // This delays the enable signal by up to 3 cycles of the input clock
982 // This must be set before the clock is enabled to have any effect
983 ADD_BITFIELD_RW(PHASE, 16, 2)
984 // Starts and stops the clock generator cleanly
985 ADD_BITFIELD_RW(ENABLE, 11, 1)
986 // Asynchronously kills the clock generator
987 ADD_BITFIELD_RW(KILL, 10, 1)
988 // Selects the auxiliary clock source, will glitch when switching
989 ADD_BITFIELD_RW(AUXSRC, 5, 3)
990 END_TYPE()
991
992 static const uint32_t CLK_ADC_CTRL_AUXSRC__clksrc_pll_usb = 0;
993 static const uint32_t CLK_ADC_CTRL_AUXSRC__clksrc_pll_sys = 1;
994 static const uint32_t CLK_ADC_CTRL_AUXSRC__rosc_clksrc_ph = 2;
995 static const uint32_t CLK_ADC_CTRL_AUXSRC__xosc_clksrc = 3;
996 static const uint32_t CLK_ADC_CTRL_AUXSRC__clksrc_gpin0 = 4;
997 static const uint32_t CLK_ADC_CTRL_AUXSRC__clksrc_gpin1 = 5;
998
999 // Clock divisor, can be changed on-the-fly
1000 // Reset value: 0x00000100
1001 BEGIN_TYPE(CLK_ADC_DIV_t, uint32_t)
1002 // Integer component of the divisor, 0 -> divide by 2^16
1003 ADD_BITFIELD_RW(INT, 8, 2)
1004 END_TYPE()
1005
1006 // Indicates which SRC is currently selected by the glitchless mux (one-hot).
1007 // This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.
1008 // Reset value: 0x00000001
1009 typedef uint32_t CLK_ADC_SELECTED_t;
1010
1011 // Clock control, can be changed on-the-fly (except for auxsrc)
1012 // Reset value: 0x00000000
1013 BEGIN_TYPE(CLK_RTC_CTRL_t, uint32_t)
1014 // An edge on this signal shifts the phase of the output by 1 cycle of the input clock
1015 // This can be done at any time
1016 ADD_BITFIELD_RW(NUDGE, 20, 1)
1017 // This delays the enable signal by up to 3 cycles of the input clock
1018 // This must be set before the clock is enabled to have any effect
1019 ADD_BITFIELD_RW(PHASE, 16, 2)
1020 // Starts and stops the clock generator cleanly
1021 ADD_BITFIELD_RW(ENABLE, 11, 1)
1022 // Asynchronously kills the clock generator
1023 ADD_BITFIELD_RW(KILL, 10, 1)
1024 // Selects the auxiliary clock source, will glitch when switching
1025 ADD_BITFIELD_RW(AUXSRC, 5, 3)
1026 END_TYPE()
1027
1028 static const uint32_t CLK_RTC_CTRL_AUXSRC__clksrc_pll_usb = 0;
1029 static const uint32_t CLK_RTC_CTRL_AUXSRC__clksrc_pll_sys = 1;
1030 static const uint32_t CLK_RTC_CTRL_AUXSRC__rosc_clksrc_ph = 2;
1031 static const uint32_t CLK_RTC_CTRL_AUXSRC__xosc_clksrc = 3;
1032 static const uint32_t CLK_RTC_CTRL_AUXSRC__clksrc_gpin0 = 4;
1033 static const uint32_t CLK_RTC_CTRL_AUXSRC__clksrc_gpin1 = 5;
1034
1035 // Clock divisor, can be changed on-the-fly
1036 // Reset value: 0x00000100
1037 BEGIN_TYPE(CLK_RTC_DIV_t, uint32_t)
1038 // Integer component of the divisor, 0 -> divide by 2^16
1039 ADD_BITFIELD_RW(INT, 8, 24)
1040 // Fractional component of the divisor
1041 ADD_BITFIELD_RW(FRAC, 0, 8)
1042 END_TYPE()
1043
1044 // Indicates which SRC is currently selected by the glitchless mux (one-hot).
1045 // This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1.
1046 // Reset value: 0x00000001
1047 typedef uint32_t CLK_RTC_SELECTED_t;
1048
1049 // Reset value: 0x000000ff
1050 BEGIN_TYPE(CLK_SYS_RESUS_CTRL_t, uint32_t)
1051 // For clearing the resus after the fault that triggered it has been corrected
1052 ADD_BITFIELD_RW(CLEAR, 16, 1)
1053 // Force a resus, for test purposes only
1054 ADD_BITFIELD_RW(FRCE, 12, 1)
1055 // Enable resus
1056 ADD_BITFIELD_RW(ENABLE, 8, 1)
1057 // This is expressed as a number of clk_ref cycles
1058 // and must be >= 2x clk_ref_freq/min_clk_tst_freq
1059 ADD_BITFIELD_RW(TIMEOUT, 0, 8)
1060 END_TYPE()
1061
1062 // Reset value: 0x00000000
1063 BEGIN_TYPE(CLK_SYS_RESUS_STATUS_t, uint32_t)
1064 // Clock has been resuscitated, correct the error then send ctrl_clear=1
1065 ADD_BITFIELD_RO(RESUSSED, 0, 1)
1066 END_TYPE()
1067
1068 // Reference clock frequency in kHz
1069 // Reset value: 0x00000000
1070 BEGIN_TYPE(FC0_REF_KHZ_t, uint32_t)
1071 ADD_BITFIELD_RW(FC0_REF_KHZ, 0, 20)
1072 END_TYPE()
1073
1074 // Minimum pass frequency in kHz. This is optional. Set to 0 if you are not using the pass/fail flags
1075 // Reset value: 0x00000000
1076 BEGIN_TYPE(FC0_MIN_KHZ_t, uint32_t)
1077 ADD_BITFIELD_RW(FC0_MIN_KHZ, 0, 25)
1078 END_TYPE()
1079
1080 // Maximum pass frequency in kHz. This is optional. Set to 0x1ffffff if you are not using the pass/fail flags
1081 // Reset value: 0x01ffffff
1082 BEGIN_TYPE(FC0_MAX_KHZ_t, uint32_t)
1083 ADD_BITFIELD_RW(FC0_MAX_KHZ, 0, 25)
1084 END_TYPE()
1085
1086 // Delays the start of frequency counting to allow the mux to settle
1087 // Delay is measured in multiples of the reference clock period
1088 // Reset value: 0x00000001
1089 BEGIN_TYPE(FC0_DELAY_t, uint32_t)
1090 ADD_BITFIELD_RW(FC0_DELAY, 0, 3)
1091 END_TYPE()
1092
1093 // The test interval is 0.98us * 2**interval, but let's call it 1us * 2**interval
1094 // The default gives a test interval of 250us
1095 // Reset value: 0x00000008
1096 BEGIN_TYPE(FC0_INTERVAL_t, uint32_t)
1097 ADD_BITFIELD_RW(FC0_INTERVAL, 0, 4)
1098 END_TYPE()
1099
1100 // Clock sent to frequency counter, set to 0 when not required
1101 // Writing to this register initiates the frequency count
1102 // Reset value: 0x00000000
1103 BEGIN_TYPE(FC0_SRC_t, uint32_t)
1104 ADD_BITFIELD_RW(FC0_SRC, 0, 8)
1105 END_TYPE()
1106
1107 static const uint32_t FC0_SRC_FC0_SRC__NULL = 0;
1108 static const uint32_t FC0_SRC_FC0_SRC__pll_sys_clksrc_primary = 1;
1109 static const uint32_t FC0_SRC_FC0_SRC__pll_usb_clksrc_primary = 2;
1110 static const uint32_t FC0_SRC_FC0_SRC__rosc_clksrc = 3;
1111 static const uint32_t FC0_SRC_FC0_SRC__rosc_clksrc_ph = 4;
1112 static const uint32_t FC0_SRC_FC0_SRC__xosc_clksrc = 5;
1113 static const uint32_t FC0_SRC_FC0_SRC__clksrc_gpin0 = 6;
1114 static const uint32_t FC0_SRC_FC0_SRC__clksrc_gpin1 = 7;
1115 static const uint32_t FC0_SRC_FC0_SRC__clk_ref = 8;
1116 static const uint32_t FC0_SRC_FC0_SRC__clk_sys = 9;
1117 static const uint32_t FC0_SRC_FC0_SRC__clk_peri = 10;
1118 static const uint32_t FC0_SRC_FC0_SRC__clk_usb = 11;
1119 static const uint32_t FC0_SRC_FC0_SRC__clk_adc = 12;
1120 static const uint32_t FC0_SRC_FC0_SRC__clk_rtc = 13;
1121
1122 // Frequency counter status
1123 // Reset value: 0x00000000
1124 BEGIN_TYPE(FC0_STATUS_t, uint32_t)
1125 // Test clock stopped during test
1126 ADD_BITFIELD_RO(DIED, 28, 1)
1127 // Test clock faster than expected, only valid when status_done=1
1128 ADD_BITFIELD_RO(FAST, 24, 1)
1129 // Test clock slower than expected, only valid when status_done=1
1130 ADD_BITFIELD_RO(SLOW, 20, 1)
1131 // Test failed
1132 ADD_BITFIELD_RO(FAIL, 16, 1)
1133 // Waiting for test clock to start
1134 ADD_BITFIELD_RO(WAITING, 12, 1)
1135 // Test running
1136 ADD_BITFIELD_RO(RUNNING, 8, 1)
1137 // Test complete
1138 ADD_BITFIELD_RO(DONE, 4, 1)
1139 // Test passed
1140 ADD_BITFIELD_RO(PASS, 0, 1)
1141 END_TYPE()
1142
1143 // Result of frequency measurement, only valid when status_done=1
1144 // Reset value: 0x00000000
1145 BEGIN_TYPE(FC0_RESULT_t, uint32_t)
1146 ADD_BITFIELD_RO(KHZ, 5, 25)
1147 ADD_BITFIELD_RO(FRAC, 0, 5)
1148 END_TYPE()
1149
1150 // enable clock in wake mode
1151 // Reset value: 0xffffffff
1152 BEGIN_TYPE(WAKE_EN0_t, uint32_t)
1153 ADD_BITFIELD_RW(clk_sys_sram3, 31, 1)
1154 ADD_BITFIELD_RW(clk_sys_sram2, 30, 1)
1155 ADD_BITFIELD_RW(clk_sys_sram1, 29, 1)
1156 ADD_BITFIELD_RW(clk_sys_sram0, 28, 1)
1157 ADD_BITFIELD_RW(clk_sys_spi1, 27, 1)
1158 ADD_BITFIELD_RW(clk_peri_spi1, 26, 1)
1159 ADD_BITFIELD_RW(clk_sys_spi0, 25, 1)
1160 ADD_BITFIELD_RW(clk_peri_spi0, 24, 1)
1161 ADD_BITFIELD_RW(clk_sys_sio, 23, 1)
1162 ADD_BITFIELD_RW(clk_sys_rtc, 22, 1)
1163 ADD_BITFIELD_RW(clk_rtc_rtc, 21, 1)
1164 ADD_BITFIELD_RW(clk_sys_rosc, 20, 1)
1165 ADD_BITFIELD_RW(clk_sys_rom, 19, 1)
1166 ADD_BITFIELD_RW(clk_sys_resets, 18, 1)
1167 ADD_BITFIELD_RW(clk_sys_pwm, 17, 1)
1168 ADD_BITFIELD_RW(clk_sys_psm, 16, 1)
1169 ADD_BITFIELD_RW(clk_sys_pll_usb, 15, 1)
1170 ADD_BITFIELD_RW(clk_sys_pll_sys, 14, 1)
1171 ADD_BITFIELD_RW(clk_sys_pio1, 13, 1)
1172 ADD_BITFIELD_RW(clk_sys_pio0, 12, 1)
1173 ADD_BITFIELD_RW(clk_sys_pads, 11, 1)
1174 ADD_BITFIELD_RW(clk_sys_vreg_and_chip_reset, 10, 1)
1175 ADD_BITFIELD_RW(clk_sys_jtag, 9, 1)
1176 ADD_BITFIELD_RW(clk_sys_io, 8, 1)
1177 ADD_BITFIELD_RW(clk_sys_i2c1, 7, 1)
1178 ADD_BITFIELD_RW(clk_sys_i2c0, 6, 1)
1179 ADD_BITFIELD_RW(clk_sys_dma, 5, 1)
1180 ADD_BITFIELD_RW(clk_sys_busfabric, 4, 1)
1181 ADD_BITFIELD_RW(clk_sys_busctrl, 3, 1)
1182 ADD_BITFIELD_RW(clk_sys_adc, 2, 1)
1183 ADD_BITFIELD_RW(clk_adc_adc, 1, 1)
1184 ADD_BITFIELD_RW(clk_sys_clocks, 0, 1)
1185 END_TYPE()
1186
1187 // enable clock in wake mode
1188 // Reset value: 0x00007fff
1189 BEGIN_TYPE(WAKE_EN1_t, uint32_t)
1190 ADD_BITFIELD_RW(clk_sys_xosc, 14, 1)
1191 ADD_BITFIELD_RW(clk_sys_xip, 13, 1)
1192 ADD_BITFIELD_RW(clk_sys_watchdog, 12, 1)
1193 ADD_BITFIELD_RW(clk_usb_usbctrl, 11, 1)
1194 ADD_BITFIELD_RW(clk_sys_usbctrl, 10, 1)
1195 ADD_BITFIELD_RW(clk_sys_uart1, 9, 1)
1196 ADD_BITFIELD_RW(clk_peri_uart1, 8, 1)
1197 ADD_BITFIELD_RW(clk_sys_uart0, 7, 1)
1198 ADD_BITFIELD_RW(clk_peri_uart0, 6, 1)
1199 ADD_BITFIELD_RW(clk_sys_timer, 5, 1)
1200 ADD_BITFIELD_RW(clk_sys_tbman, 4, 1)
1201 ADD_BITFIELD_RW(clk_sys_sysinfo, 3, 1)
1202 ADD_BITFIELD_RW(clk_sys_syscfg, 2, 1)
1203 ADD_BITFIELD_RW(clk_sys_sram5, 1, 1)
1204 ADD_BITFIELD_RW(clk_sys_sram4, 0, 1)
1205 END_TYPE()
1206
1207 // enable clock in sleep mode
1208 // Reset value: 0xffffffff
1209 BEGIN_TYPE(SLEEP_EN0_t, uint32_t)
1210 ADD_BITFIELD_RW(clk_sys_sram3, 31, 1)
1211 ADD_BITFIELD_RW(clk_sys_sram2, 30, 1)
1212 ADD_BITFIELD_RW(clk_sys_sram1, 29, 1)
1213 ADD_BITFIELD_RW(clk_sys_sram0, 28, 1)
1214 ADD_BITFIELD_RW(clk_sys_spi1, 27, 1)
1215 ADD_BITFIELD_RW(clk_peri_spi1, 26, 1)
1216 ADD_BITFIELD_RW(clk_sys_spi0, 25, 1)
1217 ADD_BITFIELD_RW(clk_peri_spi0, 24, 1)
1218 ADD_BITFIELD_RW(clk_sys_sio, 23, 1)
1219 ADD_BITFIELD_RW(clk_sys_rtc, 22, 1)
1220 ADD_BITFIELD_RW(clk_rtc_rtc, 21, 1)
1221 ADD_BITFIELD_RW(clk_sys_rosc, 20, 1)
1222 ADD_BITFIELD_RW(clk_sys_rom, 19, 1)
1223 ADD_BITFIELD_RW(clk_sys_resets, 18, 1)
1224 ADD_BITFIELD_RW(clk_sys_pwm, 17, 1)
1225 ADD_BITFIELD_RW(clk_sys_psm, 16, 1)
1226 ADD_BITFIELD_RW(clk_sys_pll_usb, 15, 1)
1227 ADD_BITFIELD_RW(clk_sys_pll_sys, 14, 1)
1228 ADD_BITFIELD_RW(clk_sys_pio1, 13, 1)
1229 ADD_BITFIELD_RW(clk_sys_pio0, 12, 1)
1230 ADD_BITFIELD_RW(clk_sys_pads, 11, 1)
1231 ADD_BITFIELD_RW(clk_sys_vreg_and_chip_reset, 10, 1)
1232 ADD_BITFIELD_RW(clk_sys_jtag, 9, 1)
1233 ADD_BITFIELD_RW(clk_sys_io, 8, 1)
1234 ADD_BITFIELD_RW(clk_sys_i2c1, 7, 1)
1235 ADD_BITFIELD_RW(clk_sys_i2c0, 6, 1)
1236 ADD_BITFIELD_RW(clk_sys_dma, 5, 1)
1237 ADD_BITFIELD_RW(clk_sys_busfabric, 4, 1)
1238 ADD_BITFIELD_RW(clk_sys_busctrl, 3, 1)
1239 ADD_BITFIELD_RW(clk_sys_adc, 2, 1)
1240 ADD_BITFIELD_RW(clk_adc_adc, 1, 1)
1241 ADD_BITFIELD_RW(clk_sys_clocks, 0, 1)
1242 END_TYPE()
1243
1244 // enable clock in sleep mode
1245 // Reset value: 0x00007fff
1246 BEGIN_TYPE(SLEEP_EN1_t, uint32_t)
1247 ADD_BITFIELD_RW(clk_sys_xosc, 14, 1)
1248 ADD_BITFIELD_RW(clk_sys_xip, 13, 1)
1249 ADD_BITFIELD_RW(clk_sys_watchdog, 12, 1)
1250 ADD_BITFIELD_RW(clk_usb_usbctrl, 11, 1)
1251 ADD_BITFIELD_RW(clk_sys_usbctrl, 10, 1)
1252 ADD_BITFIELD_RW(clk_sys_uart1, 9, 1)
1253 ADD_BITFIELD_RW(clk_peri_uart1, 8, 1)
1254 ADD_BITFIELD_RW(clk_sys_uart0, 7, 1)
1255 ADD_BITFIELD_RW(clk_peri_uart0, 6, 1)
1256 ADD_BITFIELD_RW(clk_sys_timer, 5, 1)
1257 ADD_BITFIELD_RW(clk_sys_tbman, 4, 1)
1258 ADD_BITFIELD_RW(clk_sys_sysinfo, 3, 1)
1259 ADD_BITFIELD_RW(clk_sys_syscfg, 2, 1)
1260 ADD_BITFIELD_RW(clk_sys_sram5, 1, 1)
1261 ADD_BITFIELD_RW(clk_sys_sram4, 0, 1)
1262 END_TYPE()
1263
1264 // indicates the state of the clock enable
1265 // Reset value: 0x00000000
1266 BEGIN_TYPE(ENABLED0_t, uint32_t)
1267 ADD_BITFIELD_RO(clk_sys_sram3, 31, 1)
1268 ADD_BITFIELD_RO(clk_sys_sram2, 30, 1)
1269 ADD_BITFIELD_RO(clk_sys_sram1, 29, 1)
1270 ADD_BITFIELD_RO(clk_sys_sram0, 28, 1)
1271 ADD_BITFIELD_RO(clk_sys_spi1, 27, 1)
1272 ADD_BITFIELD_RO(clk_peri_spi1, 26, 1)
1273 ADD_BITFIELD_RO(clk_sys_spi0, 25, 1)
1274 ADD_BITFIELD_RO(clk_peri_spi0, 24, 1)
1275 ADD_BITFIELD_RO(clk_sys_sio, 23, 1)
1276 ADD_BITFIELD_RO(clk_sys_rtc, 22, 1)
1277 ADD_BITFIELD_RO(clk_rtc_rtc, 21, 1)
1278 ADD_BITFIELD_RO(clk_sys_rosc, 20, 1)
1279 ADD_BITFIELD_RO(clk_sys_rom, 19, 1)
1280 ADD_BITFIELD_RO(clk_sys_resets, 18, 1)
1281 ADD_BITFIELD_RO(clk_sys_pwm, 17, 1)
1282 ADD_BITFIELD_RO(clk_sys_psm, 16, 1)
1283 ADD_BITFIELD_RO(clk_sys_pll_usb, 15, 1)
1284 ADD_BITFIELD_RO(clk_sys_pll_sys, 14, 1)
1285 ADD_BITFIELD_RO(clk_sys_pio1, 13, 1)
1286 ADD_BITFIELD_RO(clk_sys_pio0, 12, 1)
1287 ADD_BITFIELD_RO(clk_sys_pads, 11, 1)
1288 ADD_BITFIELD_RO(clk_sys_vreg_and_chip_reset, 10, 1)
1289 ADD_BITFIELD_RO(clk_sys_jtag, 9, 1)
1290 ADD_BITFIELD_RO(clk_sys_io, 8, 1)
1291 ADD_BITFIELD_RO(clk_sys_i2c1, 7, 1)
1292 ADD_BITFIELD_RO(clk_sys_i2c0, 6, 1)
1293 ADD_BITFIELD_RO(clk_sys_dma, 5, 1)
1294 ADD_BITFIELD_RO(clk_sys_busfabric, 4, 1)
1295 ADD_BITFIELD_RO(clk_sys_busctrl, 3, 1)
1296 ADD_BITFIELD_RO(clk_sys_adc, 2, 1)
1297 ADD_BITFIELD_RO(clk_adc_adc, 1, 1)
1298 ADD_BITFIELD_RO(clk_sys_clocks, 0, 1)
1299 END_TYPE()
1300
1301 // indicates the state of the clock enable
1302 // Reset value: 0x00000000
1303 BEGIN_TYPE(ENABLED1_t, uint32_t)
1304 ADD_BITFIELD_RO(clk_sys_xosc, 14, 1)
1305 ADD_BITFIELD_RO(clk_sys_xip, 13, 1)
1306 ADD_BITFIELD_RO(clk_sys_watchdog, 12, 1)
1307 ADD_BITFIELD_RO(clk_usb_usbctrl, 11, 1)
1308 ADD_BITFIELD_RO(clk_sys_usbctrl, 10, 1)
1309 ADD_BITFIELD_RO(clk_sys_uart1, 9, 1)
1310 ADD_BITFIELD_RO(clk_peri_uart1, 8, 1)
1311 ADD_BITFIELD_RO(clk_sys_uart0, 7, 1)
1312 ADD_BITFIELD_RO(clk_peri_uart0, 6, 1)
1313 ADD_BITFIELD_RO(clk_sys_timer, 5, 1)
1314 ADD_BITFIELD_RO(clk_sys_tbman, 4, 1)
1315 ADD_BITFIELD_RO(clk_sys_sysinfo, 3, 1)
1316 ADD_BITFIELD_RO(clk_sys_syscfg, 2, 1)
1317 ADD_BITFIELD_RO(clk_sys_sram5, 1, 1)
1318 ADD_BITFIELD_RO(clk_sys_sram4, 0, 1)
1319 END_TYPE()
1320
1321 // Raw Interrupts
1322 // Reset value: 0x00000000
1323 BEGIN_TYPE(INTR_t, uint32_t)
1324 ADD_BITFIELD_RO(CLK_SYS_RESUS, 0, 1)
1325 END_TYPE()
1326
1327 // Interrupt Enable
1328 // Reset value: 0x00000000
1329 BEGIN_TYPE(INTE_t, uint32_t)
1330 ADD_BITFIELD_RW(CLK_SYS_RESUS, 0, 1)
1331 END_TYPE()
1332
1333 // Interrupt Force
1334 // Reset value: 0x00000000
1335 BEGIN_TYPE(INTF_t, uint32_t)
1336 ADD_BITFIELD_RW(CLK_SYS_RESUS, 0, 1)
1337 END_TYPE()
1338
1339 // Interrupt status after masking & forcing
1340 // Reset value: 0x00000000
1341 BEGIN_TYPE(INTS_t, uint32_t)
1342 ADD_BITFIELD_RO(CLK_SYS_RESUS, 0, 1)
1343 END_TYPE()
1344
1345 struct CLOCKS_t {
1346 CLK_GPOUT0_CTRL_t CLK_GPOUT0_CTRL;
1347 CLK_GPOUT0_DIV_t CLK_GPOUT0_DIV;
1348 CLK_GPOUT0_SELECTED_t CLK_GPOUT0_SELECTED;
1349 CLK_GPOUT1_CTRL_t CLK_GPOUT1_CTRL;
1350 CLK_GPOUT1_DIV_t CLK_GPOUT1_DIV;
1351 CLK_GPOUT1_SELECTED_t CLK_GPOUT1_SELECTED;
1352 CLK_GPOUT2_CTRL_t CLK_GPOUT2_CTRL;
1353 CLK_GPOUT2_DIV_t CLK_GPOUT2_DIV;
1354 CLK_GPOUT2_SELECTED_t CLK_GPOUT2_SELECTED;
1355 CLK_GPOUT3_CTRL_t CLK_GPOUT3_CTRL;
1356 CLK_GPOUT3_DIV_t CLK_GPOUT3_DIV;
1357 CLK_GPOUT3_SELECTED_t CLK_GPOUT3_SELECTED;
1358 CLK_REF_CTRL_t CLK_REF_CTRL;
1359 CLK_REF_DIV_t CLK_REF_DIV;
1360 CLK_REF_SELECTED_t CLK_REF_SELECTED;
1361 CLK_SYS_CTRL_t CLK_SYS_CTRL;
1362 CLK_SYS_DIV_t CLK_SYS_DIV;
1363 CLK_SYS_SELECTED_t CLK_SYS_SELECTED;
1364 CLK_PERI_CTRL_t CLK_PERI_CTRL;
1365 uint32_t reserved0;
1366 CLK_PERI_SELECTED_t CLK_PERI_SELECTED;
1367 CLK_USB_CTRL_t CLK_USB_CTRL;
1368 CLK_USB_DIV_t CLK_USB_DIV;
1369 CLK_USB_SELECTED_t CLK_USB_SELECTED;
1370 CLK_ADC_CTRL_t CLK_ADC_CTRL;
1371 CLK_ADC_DIV_t CLK_ADC_DIV;
1372 CLK_ADC_SELECTED_t CLK_ADC_SELECTED;
1373 CLK_RTC_CTRL_t CLK_RTC_CTRL;
1374 CLK_RTC_DIV_t CLK_RTC_DIV;
1375 CLK_RTC_SELECTED_t CLK_RTC_SELECTED;
1376 CLK_SYS_RESUS_CTRL_t CLK_SYS_RESUS_CTRL;
1377 CLK_SYS_RESUS_STATUS_t CLK_SYS_RESUS_STATUS;
1378 FC0_REF_KHZ_t FC0_REF_KHZ;
1379 FC0_MIN_KHZ_t FC0_MIN_KHZ;
1380 FC0_MAX_KHZ_t FC0_MAX_KHZ;
1381 FC0_DELAY_t FC0_DELAY;
1382 FC0_INTERVAL_t FC0_INTERVAL;
1383 FC0_SRC_t FC0_SRC;
1384 FC0_STATUS_t FC0_STATUS;
1385 FC0_RESULT_t FC0_RESULT;
1386 WAKE_EN0_t WAKE_EN0;
1387 WAKE_EN1_t WAKE_EN1;
1388 SLEEP_EN0_t SLEEP_EN0;
1389 SLEEP_EN1_t SLEEP_EN1;
1390 ENABLED0_t ENABLED0;
1391 ENABLED1_t ENABLED1;
1392 INTR_t INTR;
1393 INTE_t INTE;
1394 INTF_t INTF;
1395 INTS_t INTS;
1396 };
1397
1398 static CLOCKS_t & CLOCKS = (*(CLOCKS_t *)0x40008000);
1399 static CLOCKS_t & CLOCKS_XOR = (*(CLOCKS_t *)0x40009000);
1400 static CLOCKS_t & CLOCKS_SET = (*(CLOCKS_t *)0x4000a000);
1401 static CLOCKS_t & CLOCKS_CLR = (*(CLOCKS_t *)0x4000b000);
1402
1403} // _CLOCKS_
1404
1405namespace _RESETS_ {
1406
1407 // Reset control. If a bit is set it means the peripheral is in reset. 0 means the peripheral's reset is deasserted.
1408 // Reset value: 0x01ffffff
1409 BEGIN_TYPE(RESET_t, uint32_t)
1410 ADD_BITFIELD_RW(usbctrl, 24, 1)
1411 ADD_BITFIELD_RW(uart1, 23, 1)
1412 ADD_BITFIELD_RW(uart0, 22, 1)
1413 ADD_BITFIELD_RW(timer, 21, 1)
1414 ADD_BITFIELD_RW(tbman, 20, 1)
1415 ADD_BITFIELD_RW(sysinfo, 19, 1)
1416 ADD_BITFIELD_RW(syscfg, 18, 1)
1417 ADD_BITFIELD_RW(spi1, 17, 1)
1418 ADD_BITFIELD_RW(spi0, 16, 1)
1419 ADD_BITFIELD_RW(rtc, 15, 1)
1420 ADD_BITFIELD_RW(pwm, 14, 1)
1421 ADD_BITFIELD_RW(pll_usb, 13, 1)
1422 ADD_BITFIELD_RW(pll_sys, 12, 1)
1423 ADD_BITFIELD_RW(pio1, 11, 1)
1424 ADD_BITFIELD_RW(pio0, 10, 1)
1425 ADD_BITFIELD_RW(pads_qspi, 9, 1)
1426 ADD_BITFIELD_RW(pads_bank0, 8, 1)
1427 ADD_BITFIELD_RW(jtag, 7, 1)
1428 ADD_BITFIELD_RW(io_qspi, 6, 1)
1429 ADD_BITFIELD_RW(io_bank0, 5, 1)
1430 ADD_BITFIELD_RW(i2c1, 4, 1)
1431 ADD_BITFIELD_RW(i2c0, 3, 1)
1432 ADD_BITFIELD_RW(dma, 2, 1)
1433 ADD_BITFIELD_RW(busctrl, 1, 1)
1434 ADD_BITFIELD_RW(adc, 0, 1)
1435 END_TYPE()
1436
1437 // Watchdog select. If a bit is set then the watchdog will reset this peripheral when the watchdog fires.
1438 // Reset value: 0x00000000
1439 BEGIN_TYPE(WDSEL_t, uint32_t)
1440 ADD_BITFIELD_RW(usbctrl, 24, 1)
1441 ADD_BITFIELD_RW(uart1, 23, 1)
1442 ADD_BITFIELD_RW(uart0, 22, 1)
1443 ADD_BITFIELD_RW(timer, 21, 1)
1444 ADD_BITFIELD_RW(tbman, 20, 1)
1445 ADD_BITFIELD_RW(sysinfo, 19, 1)
1446 ADD_BITFIELD_RW(syscfg, 18, 1)
1447 ADD_BITFIELD_RW(spi1, 17, 1)
1448 ADD_BITFIELD_RW(spi0, 16, 1)
1449 ADD_BITFIELD_RW(rtc, 15, 1)
1450 ADD_BITFIELD_RW(pwm, 14, 1)
1451 ADD_BITFIELD_RW(pll_usb, 13, 1)
1452 ADD_BITFIELD_RW(pll_sys, 12, 1)
1453 ADD_BITFIELD_RW(pio1, 11, 1)
1454 ADD_BITFIELD_RW(pio0, 10, 1)
1455 ADD_BITFIELD_RW(pads_qspi, 9, 1)
1456 ADD_BITFIELD_RW(pads_bank0, 8, 1)
1457 ADD_BITFIELD_RW(jtag, 7, 1)
1458 ADD_BITFIELD_RW(io_qspi, 6, 1)
1459 ADD_BITFIELD_RW(io_bank0, 5, 1)
1460 ADD_BITFIELD_RW(i2c1, 4, 1)
1461 ADD_BITFIELD_RW(i2c0, 3, 1)
1462 ADD_BITFIELD_RW(dma, 2, 1)
1463 ADD_BITFIELD_RW(busctrl, 1, 1)
1464 ADD_BITFIELD_RW(adc, 0, 1)
1465 END_TYPE()
1466
1467 // Reset done. If a bit is set then a reset done signal has been returned by the peripheral. This indicates that the peripheral's registers are ready to be accessed.
1468 // Reset value: 0x00000000
1469 BEGIN_TYPE(RESET_DONE_t, uint32_t)
1470 ADD_BITFIELD_RO(usbctrl, 24, 1)
1471 ADD_BITFIELD_RO(uart1, 23, 1)
1472 ADD_BITFIELD_RO(uart0, 22, 1)
1473 ADD_BITFIELD_RO(timer, 21, 1)
1474 ADD_BITFIELD_RO(tbman, 20, 1)
1475 ADD_BITFIELD_RO(sysinfo, 19, 1)
1476 ADD_BITFIELD_RO(syscfg, 18, 1)
1477 ADD_BITFIELD_RO(spi1, 17, 1)
1478 ADD_BITFIELD_RO(spi0, 16, 1)
1479 ADD_BITFIELD_RO(rtc, 15, 1)
1480 ADD_BITFIELD_RO(pwm, 14, 1)
1481 ADD_BITFIELD_RO(pll_usb, 13, 1)
1482 ADD_BITFIELD_RO(pll_sys, 12, 1)
1483 ADD_BITFIELD_RO(pio1, 11, 1)
1484 ADD_BITFIELD_RO(pio0, 10, 1)
1485 ADD_BITFIELD_RO(pads_qspi, 9, 1)
1486 ADD_BITFIELD_RO(pads_bank0, 8, 1)
1487 ADD_BITFIELD_RO(jtag, 7, 1)
1488 ADD_BITFIELD_RO(io_qspi, 6, 1)
1489 ADD_BITFIELD_RO(io_bank0, 5, 1)
1490 ADD_BITFIELD_RO(i2c1, 4, 1)
1491 ADD_BITFIELD_RO(i2c0, 3, 1)
1492 ADD_BITFIELD_RO(dma, 2, 1)
1493 ADD_BITFIELD_RO(busctrl, 1, 1)
1494 ADD_BITFIELD_RO(adc, 0, 1)
1495 END_TYPE()
1496
1497 struct RESETS_t {
1498 RESET_t RESET;
1499 WDSEL_t WDSEL;
1500 RESET_DONE_t RESET_DONE;
1501 };
1502
1503 static RESETS_t & RESETS = (*(RESETS_t *)0x4000c000);
1504 static RESETS_t & RESETS_XOR = (*(RESETS_t *)0x4000d000);
1505 static RESETS_t & RESETS_SET = (*(RESETS_t *)0x4000e000);
1506 static RESETS_t & RESETS_CLR = (*(RESETS_t *)0x4000f000);
1507
1508} // _RESETS_
1509
1510namespace _PSM_ {
1511
1512 // Force block out of reset (i.e. power it on)
1513 // Reset value: 0x00000000
1514 BEGIN_TYPE(FRCE_ON_t, uint32_t)
1515 ADD_BITFIELD_RW(proc1, 16, 1)
1516 ADD_BITFIELD_RW(proc0, 15, 1)
1517 ADD_BITFIELD_RW(sio, 14, 1)
1518 ADD_BITFIELD_RW(vreg_and_chip_reset, 13, 1)
1519 ADD_BITFIELD_RW(xip, 12, 1)
1520 ADD_BITFIELD_RW(sram5, 11, 1)
1521 ADD_BITFIELD_RW(sram4, 10, 1)
1522 ADD_BITFIELD_RW(sram3, 9, 1)
1523 ADD_BITFIELD_RW(sram2, 8, 1)
1524 ADD_BITFIELD_RW(sram1, 7, 1)
1525 ADD_BITFIELD_RW(sram0, 6, 1)
1526 ADD_BITFIELD_RW(rom, 5, 1)
1527 ADD_BITFIELD_RW(busfabric, 4, 1)
1528 ADD_BITFIELD_RW(resets, 3, 1)
1529 ADD_BITFIELD_RW(clocks, 2, 1)
1530 ADD_BITFIELD_RW(xosc, 1, 1)
1531 ADD_BITFIELD_RW(rosc, 0, 1)
1532 END_TYPE()
1533
1534 // Force into reset (i.e. power it off)
1535 // Reset value: 0x00000000
1536 BEGIN_TYPE(FRCE_OFF_t, uint32_t)
1537 ADD_BITFIELD_RW(proc1, 16, 1)
1538 ADD_BITFIELD_RW(proc0, 15, 1)
1539 ADD_BITFIELD_RW(sio, 14, 1)
1540 ADD_BITFIELD_RW(vreg_and_chip_reset, 13, 1)
1541 ADD_BITFIELD_RW(xip, 12, 1)
1542 ADD_BITFIELD_RW(sram5, 11, 1)
1543 ADD_BITFIELD_RW(sram4, 10, 1)
1544 ADD_BITFIELD_RW(sram3, 9, 1)
1545 ADD_BITFIELD_RW(sram2, 8, 1)
1546 ADD_BITFIELD_RW(sram1, 7, 1)
1547 ADD_BITFIELD_RW(sram0, 6, 1)
1548 ADD_BITFIELD_RW(rom, 5, 1)
1549 ADD_BITFIELD_RW(busfabric, 4, 1)
1550 ADD_BITFIELD_RW(resets, 3, 1)
1551 ADD_BITFIELD_RW(clocks, 2, 1)
1552 ADD_BITFIELD_RW(xosc, 1, 1)
1553 ADD_BITFIELD_RW(rosc, 0, 1)
1554 END_TYPE()
1555
1556 // Set to 1 if this peripheral should be reset when the watchdog fires.
1557 // Reset value: 0x00000000
1558 BEGIN_TYPE(WDSEL_t, uint32_t)
1559 ADD_BITFIELD_RW(proc1, 16, 1)
1560 ADD_BITFIELD_RW(proc0, 15, 1)
1561 ADD_BITFIELD_RW(sio, 14, 1)
1562 ADD_BITFIELD_RW(vreg_and_chip_reset, 13, 1)
1563 ADD_BITFIELD_RW(xip, 12, 1)
1564 ADD_BITFIELD_RW(sram5, 11, 1)
1565 ADD_BITFIELD_RW(sram4, 10, 1)
1566 ADD_BITFIELD_RW(sram3, 9, 1)
1567 ADD_BITFIELD_RW(sram2, 8, 1)
1568 ADD_BITFIELD_RW(sram1, 7, 1)
1569 ADD_BITFIELD_RW(sram0, 6, 1)
1570 ADD_BITFIELD_RW(rom, 5, 1)
1571 ADD_BITFIELD_RW(busfabric, 4, 1)
1572 ADD_BITFIELD_RW(resets, 3, 1)
1573 ADD_BITFIELD_RW(clocks, 2, 1)
1574 ADD_BITFIELD_RW(xosc, 1, 1)
1575 ADD_BITFIELD_RW(rosc, 0, 1)
1576 END_TYPE()
1577
1578 // Indicates the peripheral's registers are ready to access.
1579 // Reset value: 0x00000000
1580 BEGIN_TYPE(DONE_t, uint32_t)
1581 ADD_BITFIELD_RO(proc1, 16, 1)
1582 ADD_BITFIELD_RO(proc0, 15, 1)
1583 ADD_BITFIELD_RO(sio, 14, 1)
1584 ADD_BITFIELD_RO(vreg_and_chip_reset, 13, 1)
1585 ADD_BITFIELD_RO(xip, 12, 1)
1586 ADD_BITFIELD_RO(sram5, 11, 1)
1587 ADD_BITFIELD_RO(sram4, 10, 1)
1588 ADD_BITFIELD_RO(sram3, 9, 1)
1589 ADD_BITFIELD_RO(sram2, 8, 1)
1590 ADD_BITFIELD_RO(sram1, 7, 1)
1591 ADD_BITFIELD_RO(sram0, 6, 1)
1592 ADD_BITFIELD_RO(rom, 5, 1)
1593 ADD_BITFIELD_RO(busfabric, 4, 1)
1594 ADD_BITFIELD_RO(resets, 3, 1)
1595 ADD_BITFIELD_RO(clocks, 2, 1)
1596 ADD_BITFIELD_RO(xosc, 1, 1)
1597 ADD_BITFIELD_RO(rosc, 0, 1)
1598 END_TYPE()
1599
1600 struct PSM_t {
1601 FRCE_ON_t FRCE_ON;
1602 FRCE_OFF_t FRCE_OFF;
1603 WDSEL_t WDSEL;
1604 DONE_t DONE;
1605 };
1606
1607 static PSM_t & PSM = (*(PSM_t *)0x40010000);
1608 static PSM_t & PSM_XOR = (*(PSM_t *)0x40011000);
1609 static PSM_t & PSM_SET = (*(PSM_t *)0x40012000);
1610 static PSM_t & PSM_CLR = (*(PSM_t *)0x40013000);
1611
1612} // _PSM_
1613
1614namespace _IO_BANK0_ {
1615
1616 // GPIO status
1617 // Reset value: 0x00000000
1618 BEGIN_TYPE(GPIO_STATUS_t, uint32_t)
1619 // interrupt to processors, after override is applied
1620 ADD_BITFIELD_RO(IRQTOPROC, 26, 1)
1621 // interrupt from pad before override is applied
1622 ADD_BITFIELD_RO(IRQFROMPAD, 24, 1)
1623 // input signal to peripheral, after override is applied
1624 ADD_BITFIELD_RO(INTOPERI, 19, 1)
1625 // input signal from pad, before override is applied
1626 ADD_BITFIELD_RO(INFROMPAD, 17, 1)
1627 // output enable to pad after register override is applied
1628 ADD_BITFIELD_RO(OETOPAD, 13, 1)
1629 // output enable from selected peripheral, before register override is applied
1630 ADD_BITFIELD_RO(OEFROMPERI, 12, 1)
1631 // output signal to pad after register override is applied
1632 ADD_BITFIELD_RO(OUTTOPAD, 9, 1)
1633 // output signal from selected peripheral, before register override is applied
1634 ADD_BITFIELD_RO(OUTFROMPERI, 8, 1)
1635 END_TYPE()
1636
1637 // GPIO control including function select and overrides.
1638 // Reset value: 0x0000001f
1639 BEGIN_TYPE(GPIO_CTRL_t, uint32_t)
1640 ADD_BITFIELD_RW(IRQOVER, 28, 2)
1641 ADD_BITFIELD_RW(INOVER, 16, 2)
1642 ADD_BITFIELD_RW(OEOVER, 12, 2)
1643 ADD_BITFIELD_RW(OUTOVER, 8, 2)
1644 // 0-31 -> selects pin function according to the gpio table
1645 // 31 == NULL
1646 ADD_BITFIELD_RW(FUNCSEL, 0, 5)
1647 END_TYPE()
1648
1649 // don't invert the interrupt
1650 static const uint32_t GPIO_CTRL_IRQOVER__NORMAL = 0;
1651 // invert the interrupt
1652 static const uint32_t GPIO_CTRL_IRQOVER__INVERT = 1;
1653 // drive interrupt low
1654 static const uint32_t GPIO_CTRL_IRQOVER__LOW = 2;
1655 // drive interrupt high
1656 static const uint32_t GPIO_CTRL_IRQOVER__HIGH = 3;
1657 // don't invert the peri input
1658 static const uint32_t GPIO_CTRL_INOVER__NORMAL = 0;
1659 // invert the peri input
1660 static const uint32_t GPIO_CTRL_INOVER__INVERT = 1;
1661 // drive peri input low
1662 static const uint32_t GPIO_CTRL_INOVER__LOW = 2;
1663 // drive peri input high
1664 static const uint32_t GPIO_CTRL_INOVER__HIGH = 3;
1665 // drive output enable from peripheral signal selected by funcsel
1666 static const uint32_t GPIO_CTRL_OEOVER__NORMAL = 0;
1667 // drive output enable from inverse of peripheral signal selected by funcsel
1668 static const uint32_t GPIO_CTRL_OEOVER__INVERT = 1;
1669 // disable output
1670 static const uint32_t GPIO_CTRL_OEOVER__DISABLE = 2;
1671 // enable output
1672 static const uint32_t GPIO_CTRL_OEOVER__ENABLE = 3;
1673 // drive output from peripheral signal selected by funcsel
1674 static const uint32_t GPIO_CTRL_OUTOVER__NORMAL = 0;
1675 // drive output from inverse of peripheral signal selected by funcsel
1676 static const uint32_t GPIO_CTRL_OUTOVER__INVERT = 1;
1677 // drive output low
1678 static const uint32_t GPIO_CTRL_OUTOVER__LOW = 2;
1679 // drive output high
1680 static const uint32_t GPIO_CTRL_OUTOVER__HIGH = 3;
1681 static const uint32_t GPIO_CTRL_FUNCSEL__jtag = 0;
1682 static const uint32_t GPIO_CTRL_FUNCSEL__spi = 1;
1683 static const uint32_t GPIO_CTRL_FUNCSEL__uart = 2;
1684 static const uint32_t GPIO_CTRL_FUNCSEL__i2c = 3;
1685 static const uint32_t GPIO_CTRL_FUNCSEL__pwm = 4;
1686 static const uint32_t GPIO_CTRL_FUNCSEL__sio = 5;
1687 static const uint32_t GPIO_CTRL_FUNCSEL__pio0 = 6;
1688 static const uint32_t GPIO_CTRL_FUNCSEL__pio1 = 7;
1689 static const uint32_t GPIO_CTRL_FUNCSEL__clock = 8;
1690 static const uint32_t GPIO_CTRL_FUNCSEL__usb = 9;
1691 static const uint32_t GPIO_CTRL_FUNCSEL__null = 31;
1692
1693 // Raw Interrupts
1694 // Reset value: 0x00000000
1695 BEGIN_TYPE(INTR0_t, uint32_t)
1696 ADD_BITFIELD_RW(GPIO7_EDGE_HIGH, 31, 1)
1697 ADD_BITFIELD_RW(GPIO7_EDGE_LOW, 30, 1)
1698 ADD_BITFIELD_RO(GPIO7_LEVEL_HIGH, 29, 1)
1699 ADD_BITFIELD_RO(GPIO7_LEVEL_LOW, 28, 1)
1700 ADD_BITFIELD_RW(GPIO6_EDGE_HIGH, 27, 1)
1701 ADD_BITFIELD_RW(GPIO6_EDGE_LOW, 26, 1)
1702 ADD_BITFIELD_RO(GPIO6_LEVEL_HIGH, 25, 1)
1703 ADD_BITFIELD_RO(GPIO6_LEVEL_LOW, 24, 1)
1704 ADD_BITFIELD_RW(GPIO5_EDGE_HIGH, 23, 1)
1705 ADD_BITFIELD_RW(GPIO5_EDGE_LOW, 22, 1)
1706 ADD_BITFIELD_RO(GPIO5_LEVEL_HIGH, 21, 1)
1707 ADD_BITFIELD_RO(GPIO5_LEVEL_LOW, 20, 1)
1708 ADD_BITFIELD_RW(GPIO4_EDGE_HIGH, 19, 1)
1709 ADD_BITFIELD_RW(GPIO4_EDGE_LOW, 18, 1)
1710 ADD_BITFIELD_RO(GPIO4_LEVEL_HIGH, 17, 1)
1711 ADD_BITFIELD_RO(GPIO4_LEVEL_LOW, 16, 1)
1712 ADD_BITFIELD_RW(GPIO3_EDGE_HIGH, 15, 1)
1713 ADD_BITFIELD_RW(GPIO3_EDGE_LOW, 14, 1)
1714 ADD_BITFIELD_RO(GPIO3_LEVEL_HIGH, 13, 1)
1715 ADD_BITFIELD_RO(GPIO3_LEVEL_LOW, 12, 1)
1716 ADD_BITFIELD_RW(GPIO2_EDGE_HIGH, 11, 1)
1717 ADD_BITFIELD_RW(GPIO2_EDGE_LOW, 10, 1)
1718 ADD_BITFIELD_RO(GPIO2_LEVEL_HIGH, 9, 1)
1719 ADD_BITFIELD_RO(GPIO2_LEVEL_LOW, 8, 1)
1720 ADD_BITFIELD_RW(GPIO1_EDGE_HIGH, 7, 1)
1721 ADD_BITFIELD_RW(GPIO1_EDGE_LOW, 6, 1)
1722 ADD_BITFIELD_RO(GPIO1_LEVEL_HIGH, 5, 1)
1723 ADD_BITFIELD_RO(GPIO1_LEVEL_LOW, 4, 1)
1724 ADD_BITFIELD_RW(GPIO0_EDGE_HIGH, 3, 1)
1725 ADD_BITFIELD_RW(GPIO0_EDGE_LOW, 2, 1)
1726 ADD_BITFIELD_RO(GPIO0_LEVEL_HIGH, 1, 1)
1727 ADD_BITFIELD_RO(GPIO0_LEVEL_LOW, 0, 1)
1728 END_TYPE()
1729
1730 // Raw Interrupts
1731 // Reset value: 0x00000000
1732 BEGIN_TYPE(INTR1_t, uint32_t)
1733 ADD_BITFIELD_RW(GPIO15_EDGE_HIGH, 31, 1)
1734 ADD_BITFIELD_RW(GPIO15_EDGE_LOW, 30, 1)
1735 ADD_BITFIELD_RO(GPIO15_LEVEL_HIGH, 29, 1)
1736 ADD_BITFIELD_RO(GPIO15_LEVEL_LOW, 28, 1)
1737 ADD_BITFIELD_RW(GPIO14_EDGE_HIGH, 27, 1)
1738 ADD_BITFIELD_RW(GPIO14_EDGE_LOW, 26, 1)
1739 ADD_BITFIELD_RO(GPIO14_LEVEL_HIGH, 25, 1)
1740 ADD_BITFIELD_RO(GPIO14_LEVEL_LOW, 24, 1)
1741 ADD_BITFIELD_RW(GPIO13_EDGE_HIGH, 23, 1)
1742 ADD_BITFIELD_RW(GPIO13_EDGE_LOW, 22, 1)
1743 ADD_BITFIELD_RO(GPIO13_LEVEL_HIGH, 21, 1)
1744 ADD_BITFIELD_RO(GPIO13_LEVEL_LOW, 20, 1)
1745 ADD_BITFIELD_RW(GPIO12_EDGE_HIGH, 19, 1)
1746 ADD_BITFIELD_RW(GPIO12_EDGE_LOW, 18, 1)
1747 ADD_BITFIELD_RO(GPIO12_LEVEL_HIGH, 17, 1)
1748 ADD_BITFIELD_RO(GPIO12_LEVEL_LOW, 16, 1)
1749 ADD_BITFIELD_RW(GPIO11_EDGE_HIGH, 15, 1)
1750 ADD_BITFIELD_RW(GPIO11_EDGE_LOW, 14, 1)
1751 ADD_BITFIELD_RO(GPIO11_LEVEL_HIGH, 13, 1)
1752 ADD_BITFIELD_RO(GPIO11_LEVEL_LOW, 12, 1)
1753 ADD_BITFIELD_RW(GPIO10_EDGE_HIGH, 11, 1)
1754 ADD_BITFIELD_RW(GPIO10_EDGE_LOW, 10, 1)
1755 ADD_BITFIELD_RO(GPIO10_LEVEL_HIGH, 9, 1)
1756 ADD_BITFIELD_RO(GPIO10_LEVEL_LOW, 8, 1)
1757 ADD_BITFIELD_RW(GPIO9_EDGE_HIGH, 7, 1)
1758 ADD_BITFIELD_RW(GPIO9_EDGE_LOW, 6, 1)
1759 ADD_BITFIELD_RO(GPIO9_LEVEL_HIGH, 5, 1)
1760 ADD_BITFIELD_RO(GPIO9_LEVEL_LOW, 4, 1)
1761 ADD_BITFIELD_RW(GPIO8_EDGE_HIGH, 3, 1)
1762 ADD_BITFIELD_RW(GPIO8_EDGE_LOW, 2, 1)
1763 ADD_BITFIELD_RO(GPIO8_LEVEL_HIGH, 1, 1)
1764 ADD_BITFIELD_RO(GPIO8_LEVEL_LOW, 0, 1)
1765 END_TYPE()
1766
1767 // Raw Interrupts
1768 // Reset value: 0x00000000
1769 BEGIN_TYPE(INTR2_t, uint32_t)
1770 ADD_BITFIELD_RW(GPIO23_EDGE_HIGH, 31, 1)
1771 ADD_BITFIELD_RW(GPIO23_EDGE_LOW, 30, 1)
1772 ADD_BITFIELD_RO(GPIO23_LEVEL_HIGH, 29, 1)
1773 ADD_BITFIELD_RO(GPIO23_LEVEL_LOW, 28, 1)
1774 ADD_BITFIELD_RW(GPIO22_EDGE_HIGH, 27, 1)
1775 ADD_BITFIELD_RW(GPIO22_EDGE_LOW, 26, 1)
1776 ADD_BITFIELD_RO(GPIO22_LEVEL_HIGH, 25, 1)
1777 ADD_BITFIELD_RO(GPIO22_LEVEL_LOW, 24, 1)
1778 ADD_BITFIELD_RW(GPIO21_EDGE_HIGH, 23, 1)
1779 ADD_BITFIELD_RW(GPIO21_EDGE_LOW, 22, 1)
1780 ADD_BITFIELD_RO(GPIO21_LEVEL_HIGH, 21, 1)
1781 ADD_BITFIELD_RO(GPIO21_LEVEL_LOW, 20, 1)
1782 ADD_BITFIELD_RW(GPIO20_EDGE_HIGH, 19, 1)
1783 ADD_BITFIELD_RW(GPIO20_EDGE_LOW, 18, 1)
1784 ADD_BITFIELD_RO(GPIO20_LEVEL_HIGH, 17, 1)
1785 ADD_BITFIELD_RO(GPIO20_LEVEL_LOW, 16, 1)
1786 ADD_BITFIELD_RW(GPIO19_EDGE_HIGH, 15, 1)
1787 ADD_BITFIELD_RW(GPIO19_EDGE_LOW, 14, 1)
1788 ADD_BITFIELD_RO(GPIO19_LEVEL_HIGH, 13, 1)
1789 ADD_BITFIELD_RO(GPIO19_LEVEL_LOW, 12, 1)
1790 ADD_BITFIELD_RW(GPIO18_EDGE_HIGH, 11, 1)
1791 ADD_BITFIELD_RW(GPIO18_EDGE_LOW, 10, 1)
1792 ADD_BITFIELD_RO(GPIO18_LEVEL_HIGH, 9, 1)
1793 ADD_BITFIELD_RO(GPIO18_LEVEL_LOW, 8, 1)
1794 ADD_BITFIELD_RW(GPIO17_EDGE_HIGH, 7, 1)
1795 ADD_BITFIELD_RW(GPIO17_EDGE_LOW, 6, 1)
1796 ADD_BITFIELD_RO(GPIO17_LEVEL_HIGH, 5, 1)
1797 ADD_BITFIELD_RO(GPIO17_LEVEL_LOW, 4, 1)
1798 ADD_BITFIELD_RW(GPIO16_EDGE_HIGH, 3, 1)
1799 ADD_BITFIELD_RW(GPIO16_EDGE_LOW, 2, 1)
1800 ADD_BITFIELD_RO(GPIO16_LEVEL_HIGH, 1, 1)
1801 ADD_BITFIELD_RO(GPIO16_LEVEL_LOW, 0, 1)
1802 END_TYPE()
1803
1804 // Raw Interrupts
1805 // Reset value: 0x00000000
1806 BEGIN_TYPE(INTR3_t, uint32_t)
1807 ADD_BITFIELD_RW(GPIO29_EDGE_HIGH, 23, 1)
1808 ADD_BITFIELD_RW(GPIO29_EDGE_LOW, 22, 1)
1809 ADD_BITFIELD_RO(GPIO29_LEVEL_HIGH, 21, 1)
1810 ADD_BITFIELD_RO(GPIO29_LEVEL_LOW, 20, 1)
1811 ADD_BITFIELD_RW(GPIO28_EDGE_HIGH, 19, 1)
1812 ADD_BITFIELD_RW(GPIO28_EDGE_LOW, 18, 1)
1813 ADD_BITFIELD_RO(GPIO28_LEVEL_HIGH, 17, 1)
1814 ADD_BITFIELD_RO(GPIO28_LEVEL_LOW, 16, 1)
1815 ADD_BITFIELD_RW(GPIO27_EDGE_HIGH, 15, 1)
1816 ADD_BITFIELD_RW(GPIO27_EDGE_LOW, 14, 1)
1817 ADD_BITFIELD_RO(GPIO27_LEVEL_HIGH, 13, 1)
1818 ADD_BITFIELD_RO(GPIO27_LEVEL_LOW, 12, 1)
1819 ADD_BITFIELD_RW(GPIO26_EDGE_HIGH, 11, 1)
1820 ADD_BITFIELD_RW(GPIO26_EDGE_LOW, 10, 1)
1821 ADD_BITFIELD_RO(GPIO26_LEVEL_HIGH, 9, 1)
1822 ADD_BITFIELD_RO(GPIO26_LEVEL_LOW, 8, 1)
1823 ADD_BITFIELD_RW(GPIO25_EDGE_HIGH, 7, 1)
1824 ADD_BITFIELD_RW(GPIO25_EDGE_LOW, 6, 1)
1825 ADD_BITFIELD_RO(GPIO25_LEVEL_HIGH, 5, 1)
1826 ADD_BITFIELD_RO(GPIO25_LEVEL_LOW, 4, 1)
1827 ADD_BITFIELD_RW(GPIO24_EDGE_HIGH, 3, 1)
1828 ADD_BITFIELD_RW(GPIO24_EDGE_LOW, 2, 1)
1829 ADD_BITFIELD_RO(GPIO24_LEVEL_HIGH, 1, 1)
1830 ADD_BITFIELD_RO(GPIO24_LEVEL_LOW, 0, 1)
1831 END_TYPE()
1832
1833 // Interrupt Enable for proc0
1834 // Reset value: 0x00000000
1835 BEGIN_TYPE(PROC0_INTE0_t, uint32_t)
1836 ADD_BITFIELD_RW(GPIO7_EDGE_HIGH, 31, 1)
1837 ADD_BITFIELD_RW(GPIO7_EDGE_LOW, 30, 1)
1838 ADD_BITFIELD_RW(GPIO7_LEVEL_HIGH, 29, 1)
1839 ADD_BITFIELD_RW(GPIO7_LEVEL_LOW, 28, 1)
1840 ADD_BITFIELD_RW(GPIO6_EDGE_HIGH, 27, 1)
1841 ADD_BITFIELD_RW(GPIO6_EDGE_LOW, 26, 1)
1842 ADD_BITFIELD_RW(GPIO6_LEVEL_HIGH, 25, 1)
1843 ADD_BITFIELD_RW(GPIO6_LEVEL_LOW, 24, 1)
1844 ADD_BITFIELD_RW(GPIO5_EDGE_HIGH, 23, 1)
1845 ADD_BITFIELD_RW(GPIO5_EDGE_LOW, 22, 1)
1846 ADD_BITFIELD_RW(GPIO5_LEVEL_HIGH, 21, 1)
1847 ADD_BITFIELD_RW(GPIO5_LEVEL_LOW, 20, 1)
1848 ADD_BITFIELD_RW(GPIO4_EDGE_HIGH, 19, 1)
1849 ADD_BITFIELD_RW(GPIO4_EDGE_LOW, 18, 1)
1850 ADD_BITFIELD_RW(GPIO4_LEVEL_HIGH, 17, 1)
1851 ADD_BITFIELD_RW(GPIO4_LEVEL_LOW, 16, 1)
1852 ADD_BITFIELD_RW(GPIO3_EDGE_HIGH, 15, 1)
1853 ADD_BITFIELD_RW(GPIO3_EDGE_LOW, 14, 1)
1854 ADD_BITFIELD_RW(GPIO3_LEVEL_HIGH, 13, 1)
1855 ADD_BITFIELD_RW(GPIO3_LEVEL_LOW, 12, 1)
1856 ADD_BITFIELD_RW(GPIO2_EDGE_HIGH, 11, 1)
1857 ADD_BITFIELD_RW(GPIO2_EDGE_LOW, 10, 1)
1858 ADD_BITFIELD_RW(GPIO2_LEVEL_HIGH, 9, 1)
1859 ADD_BITFIELD_RW(GPIO2_LEVEL_LOW, 8, 1)
1860 ADD_BITFIELD_RW(GPIO1_EDGE_HIGH, 7, 1)
1861 ADD_BITFIELD_RW(GPIO1_EDGE_LOW, 6, 1)
1862 ADD_BITFIELD_RW(GPIO1_LEVEL_HIGH, 5, 1)
1863 ADD_BITFIELD_RW(GPIO1_LEVEL_LOW, 4, 1)
1864 ADD_BITFIELD_RW(GPIO0_EDGE_HIGH, 3, 1)
1865 ADD_BITFIELD_RW(GPIO0_EDGE_LOW, 2, 1)
1866 ADD_BITFIELD_RW(GPIO0_LEVEL_HIGH, 1, 1)
1867 ADD_BITFIELD_RW(GPIO0_LEVEL_LOW, 0, 1)
1868 END_TYPE()
1869
1870 // Interrupt Enable for proc0
1871 // Reset value: 0x00000000
1872 BEGIN_TYPE(PROC0_INTE1_t, uint32_t)
1873 ADD_BITFIELD_RW(GPIO15_EDGE_HIGH, 31, 1)
1874 ADD_BITFIELD_RW(GPIO15_EDGE_LOW, 30, 1)
1875 ADD_BITFIELD_RW(GPIO15_LEVEL_HIGH, 29, 1)
1876 ADD_BITFIELD_RW(GPIO15_LEVEL_LOW, 28, 1)
1877 ADD_BITFIELD_RW(GPIO14_EDGE_HIGH, 27, 1)
1878 ADD_BITFIELD_RW(GPIO14_EDGE_LOW, 26, 1)
1879 ADD_BITFIELD_RW(GPIO14_LEVEL_HIGH, 25, 1)
1880 ADD_BITFIELD_RW(GPIO14_LEVEL_LOW, 24, 1)
1881 ADD_BITFIELD_RW(GPIO13_EDGE_HIGH, 23, 1)
1882 ADD_BITFIELD_RW(GPIO13_EDGE_LOW, 22, 1)
1883 ADD_BITFIELD_RW(GPIO13_LEVEL_HIGH, 21, 1)
1884 ADD_BITFIELD_RW(GPIO13_LEVEL_LOW, 20, 1)
1885 ADD_BITFIELD_RW(GPIO12_EDGE_HIGH, 19, 1)
1886 ADD_BITFIELD_RW(GPIO12_EDGE_LOW, 18, 1)
1887 ADD_BITFIELD_RW(GPIO12_LEVEL_HIGH, 17, 1)
1888 ADD_BITFIELD_RW(GPIO12_LEVEL_LOW, 16, 1)
1889 ADD_BITFIELD_RW(GPIO11_EDGE_HIGH, 15, 1)
1890 ADD_BITFIELD_RW(GPIO11_EDGE_LOW, 14, 1)
1891 ADD_BITFIELD_RW(GPIO11_LEVEL_HIGH, 13, 1)
1892 ADD_BITFIELD_RW(GPIO11_LEVEL_LOW, 12, 1)
1893 ADD_BITFIELD_RW(GPIO10_EDGE_HIGH, 11, 1)
1894 ADD_BITFIELD_RW(GPIO10_EDGE_LOW, 10, 1)
1895 ADD_BITFIELD_RW(GPIO10_LEVEL_HIGH, 9, 1)
1896 ADD_BITFIELD_RW(GPIO10_LEVEL_LOW, 8, 1)
1897 ADD_BITFIELD_RW(GPIO9_EDGE_HIGH, 7, 1)
1898 ADD_BITFIELD_RW(GPIO9_EDGE_LOW, 6, 1)
1899 ADD_BITFIELD_RW(GPIO9_LEVEL_HIGH, 5, 1)
1900 ADD_BITFIELD_RW(GPIO9_LEVEL_LOW, 4, 1)
1901 ADD_BITFIELD_RW(GPIO8_EDGE_HIGH, 3, 1)
1902 ADD_BITFIELD_RW(GPIO8_EDGE_LOW, 2, 1)
1903 ADD_BITFIELD_RW(GPIO8_LEVEL_HIGH, 1, 1)
1904 ADD_BITFIELD_RW(GPIO8_LEVEL_LOW, 0, 1)
1905 END_TYPE()
1906
1907 // Interrupt Enable for proc0
1908 // Reset value: 0x00000000
1909 BEGIN_TYPE(PROC0_INTE2_t, uint32_t)
1910 ADD_BITFIELD_RW(GPIO23_EDGE_HIGH, 31, 1)
1911 ADD_BITFIELD_RW(GPIO23_EDGE_LOW, 30, 1)
1912 ADD_BITFIELD_RW(GPIO23_LEVEL_HIGH, 29, 1)
1913 ADD_BITFIELD_RW(GPIO23_LEVEL_LOW, 28, 1)
1914 ADD_BITFIELD_RW(GPIO22_EDGE_HIGH, 27, 1)
1915 ADD_BITFIELD_RW(GPIO22_EDGE_LOW, 26, 1)
1916 ADD_BITFIELD_RW(GPIO22_LEVEL_HIGH, 25, 1)
1917 ADD_BITFIELD_RW(GPIO22_LEVEL_LOW, 24, 1)
1918 ADD_BITFIELD_RW(GPIO21_EDGE_HIGH, 23, 1)
1919 ADD_BITFIELD_RW(GPIO21_EDGE_LOW, 22, 1)
1920 ADD_BITFIELD_RW(GPIO21_LEVEL_HIGH, 21, 1)
1921 ADD_BITFIELD_RW(GPIO21_LEVEL_LOW, 20, 1)
1922 ADD_BITFIELD_RW(GPIO20_EDGE_HIGH, 19, 1)
1923 ADD_BITFIELD_RW(GPIO20_EDGE_LOW, 18, 1)
1924 ADD_BITFIELD_RW(GPIO20_LEVEL_HIGH, 17, 1)
1925 ADD_BITFIELD_RW(GPIO20_LEVEL_LOW, 16, 1)
1926 ADD_BITFIELD_RW(GPIO19_EDGE_HIGH, 15, 1)
1927 ADD_BITFIELD_RW(GPIO19_EDGE_LOW, 14, 1)
1928 ADD_BITFIELD_RW(GPIO19_LEVEL_HIGH, 13, 1)
1929 ADD_BITFIELD_RW(GPIO19_LEVEL_LOW, 12, 1)
1930 ADD_BITFIELD_RW(GPIO18_EDGE_HIGH, 11, 1)
1931 ADD_BITFIELD_RW(GPIO18_EDGE_LOW, 10, 1)
1932 ADD_BITFIELD_RW(GPIO18_LEVEL_HIGH, 9, 1)
1933 ADD_BITFIELD_RW(GPIO18_LEVEL_LOW, 8, 1)
1934 ADD_BITFIELD_RW(GPIO17_EDGE_HIGH, 7, 1)
1935 ADD_BITFIELD_RW(GPIO17_EDGE_LOW, 6, 1)
1936 ADD_BITFIELD_RW(GPIO17_LEVEL_HIGH, 5, 1)
1937 ADD_BITFIELD_RW(GPIO17_LEVEL_LOW, 4, 1)
1938 ADD_BITFIELD_RW(GPIO16_EDGE_HIGH, 3, 1)
1939 ADD_BITFIELD_RW(GPIO16_EDGE_LOW, 2, 1)
1940 ADD_BITFIELD_RW(GPIO16_LEVEL_HIGH, 1, 1)
1941 ADD_BITFIELD_RW(GPIO16_LEVEL_LOW, 0, 1)
1942 END_TYPE()
1943
1944 // Interrupt Enable for proc0
1945 // Reset value: 0x00000000
1946 BEGIN_TYPE(PROC0_INTE3_t, uint32_t)
1947 ADD_BITFIELD_RW(GPIO29_EDGE_HIGH, 23, 1)
1948 ADD_BITFIELD_RW(GPIO29_EDGE_LOW, 22, 1)
1949 ADD_BITFIELD_RW(GPIO29_LEVEL_HIGH, 21, 1)
1950 ADD_BITFIELD_RW(GPIO29_LEVEL_LOW, 20, 1)
1951 ADD_BITFIELD_RW(GPIO28_EDGE_HIGH, 19, 1)
1952 ADD_BITFIELD_RW(GPIO28_EDGE_LOW, 18, 1)
1953 ADD_BITFIELD_RW(GPIO28_LEVEL_HIGH, 17, 1)
1954 ADD_BITFIELD_RW(GPIO28_LEVEL_LOW, 16, 1)
1955 ADD_BITFIELD_RW(GPIO27_EDGE_HIGH, 15, 1)
1956 ADD_BITFIELD_RW(GPIO27_EDGE_LOW, 14, 1)
1957 ADD_BITFIELD_RW(GPIO27_LEVEL_HIGH, 13, 1)
1958 ADD_BITFIELD_RW(GPIO27_LEVEL_LOW, 12, 1)
1959 ADD_BITFIELD_RW(GPIO26_EDGE_HIGH, 11, 1)
1960 ADD_BITFIELD_RW(GPIO26_EDGE_LOW, 10, 1)
1961 ADD_BITFIELD_RW(GPIO26_LEVEL_HIGH, 9, 1)
1962 ADD_BITFIELD_RW(GPIO26_LEVEL_LOW, 8, 1)
1963 ADD_BITFIELD_RW(GPIO25_EDGE_HIGH, 7, 1)
1964 ADD_BITFIELD_RW(GPIO25_EDGE_LOW, 6, 1)
1965 ADD_BITFIELD_RW(GPIO25_LEVEL_HIGH, 5, 1)
1966 ADD_BITFIELD_RW(GPIO25_LEVEL_LOW, 4, 1)
1967 ADD_BITFIELD_RW(GPIO24_EDGE_HIGH, 3, 1)
1968 ADD_BITFIELD_RW(GPIO24_EDGE_LOW, 2, 1)
1969 ADD_BITFIELD_RW(GPIO24_LEVEL_HIGH, 1, 1)
1970 ADD_BITFIELD_RW(GPIO24_LEVEL_LOW, 0, 1)
1971 END_TYPE()
1972
1973 // Interrupt Force for proc0
1974 // Reset value: 0x00000000
1975 BEGIN_TYPE(PROC0_INTF0_t, uint32_t)
1976 ADD_BITFIELD_RW(GPIO7_EDGE_HIGH, 31, 1)
1977 ADD_BITFIELD_RW(GPIO7_EDGE_LOW, 30, 1)
1978 ADD_BITFIELD_RW(GPIO7_LEVEL_HIGH, 29, 1)
1979 ADD_BITFIELD_RW(GPIO7_LEVEL_LOW, 28, 1)
1980 ADD_BITFIELD_RW(GPIO6_EDGE_HIGH, 27, 1)
1981 ADD_BITFIELD_RW(GPIO6_EDGE_LOW, 26, 1)
1982 ADD_BITFIELD_RW(GPIO6_LEVEL_HIGH, 25, 1)
1983 ADD_BITFIELD_RW(GPIO6_LEVEL_LOW, 24, 1)
1984 ADD_BITFIELD_RW(GPIO5_EDGE_HIGH, 23, 1)
1985 ADD_BITFIELD_RW(GPIO5_EDGE_LOW, 22, 1)
1986 ADD_BITFIELD_RW(GPIO5_LEVEL_HIGH, 21, 1)
1987 ADD_BITFIELD_RW(GPIO5_LEVEL_LOW, 20, 1)
1988 ADD_BITFIELD_RW(GPIO4_EDGE_HIGH, 19, 1)
1989 ADD_BITFIELD_RW(GPIO4_EDGE_LOW, 18, 1)
1990 ADD_BITFIELD_RW(GPIO4_LEVEL_HIGH, 17, 1)
1991 ADD_BITFIELD_RW(GPIO4_LEVEL_LOW, 16, 1)
1992 ADD_BITFIELD_RW(GPIO3_EDGE_HIGH, 15, 1)
1993 ADD_BITFIELD_RW(GPIO3_EDGE_LOW, 14, 1)
1994 ADD_BITFIELD_RW(GPIO3_LEVEL_HIGH, 13, 1)
1995 ADD_BITFIELD_RW(GPIO3_LEVEL_LOW, 12, 1)
1996 ADD_BITFIELD_RW(GPIO2_EDGE_HIGH, 11, 1)
1997 ADD_BITFIELD_RW(GPIO2_EDGE_LOW, 10, 1)
1998 ADD_BITFIELD_RW(GPIO2_LEVEL_HIGH, 9, 1)
1999 ADD_BITFIELD_RW(GPIO2_LEVEL_LOW, 8, 1)
2000 ADD_BITFIELD_RW(GPIO1_EDGE_HIGH, 7, 1)
2001 ADD_BITFIELD_RW(GPIO1_EDGE_LOW, 6, 1)
2002 ADD_BITFIELD_RW(GPIO1_LEVEL_HIGH, 5, 1)
2003 ADD_BITFIELD_RW(GPIO1_LEVEL_LOW, 4, 1)
2004 ADD_BITFIELD_RW(GPIO0_EDGE_HIGH, 3, 1)
2005 ADD_BITFIELD_RW(GPIO0_EDGE_LOW, 2, 1)
2006 ADD_BITFIELD_RW(GPIO0_LEVEL_HIGH, 1, 1)
2007 ADD_BITFIELD_RW(GPIO0_LEVEL_LOW, 0, 1)
2008 END_TYPE()
2009
2010 // Interrupt Force for proc0
2011 // Reset value: 0x00000000
2012 BEGIN_TYPE(PROC0_INTF1_t, uint32_t)
2013 ADD_BITFIELD_RW(GPIO15_EDGE_HIGH, 31, 1)
2014 ADD_BITFIELD_RW(GPIO15_EDGE_LOW, 30, 1)
2015 ADD_BITFIELD_RW(GPIO15_LEVEL_HIGH, 29, 1)
2016 ADD_BITFIELD_RW(GPIO15_LEVEL_LOW, 28, 1)
2017 ADD_BITFIELD_RW(GPIO14_EDGE_HIGH, 27, 1)
2018 ADD_BITFIELD_RW(GPIO14_EDGE_LOW, 26, 1)
2019 ADD_BITFIELD_RW(GPIO14_LEVEL_HIGH, 25, 1)
2020 ADD_BITFIELD_RW(GPIO14_LEVEL_LOW, 24, 1)
2021 ADD_BITFIELD_RW(GPIO13_EDGE_HIGH, 23, 1)
2022 ADD_BITFIELD_RW(GPIO13_EDGE_LOW, 22, 1)
2023 ADD_BITFIELD_RW(GPIO13_LEVEL_HIGH, 21, 1)
2024 ADD_BITFIELD_RW(GPIO13_LEVEL_LOW, 20, 1)
2025 ADD_BITFIELD_RW(GPIO12_EDGE_HIGH, 19, 1)
2026 ADD_BITFIELD_RW(GPIO12_EDGE_LOW, 18, 1)
2027 ADD_BITFIELD_RW(GPIO12_LEVEL_HIGH, 17, 1)
2028 ADD_BITFIELD_RW(GPIO12_LEVEL_LOW, 16, 1)
2029 ADD_BITFIELD_RW(GPIO11_EDGE_HIGH, 15, 1)
2030 ADD_BITFIELD_RW(GPIO11_EDGE_LOW, 14, 1)
2031 ADD_BITFIELD_RW(GPIO11_LEVEL_HIGH, 13, 1)
2032 ADD_BITFIELD_RW(GPIO11_LEVEL_LOW, 12, 1)
2033 ADD_BITFIELD_RW(GPIO10_EDGE_HIGH, 11, 1)
2034 ADD_BITFIELD_RW(GPIO10_EDGE_LOW, 10, 1)
2035 ADD_BITFIELD_RW(GPIO10_LEVEL_HIGH, 9, 1)
2036 ADD_BITFIELD_RW(GPIO10_LEVEL_LOW, 8, 1)
2037 ADD_BITFIELD_RW(GPIO9_EDGE_HIGH, 7, 1)
2038 ADD_BITFIELD_RW(GPIO9_EDGE_LOW, 6, 1)
2039 ADD_BITFIELD_RW(GPIO9_LEVEL_HIGH, 5, 1)
2040 ADD_BITFIELD_RW(GPIO9_LEVEL_LOW, 4, 1)
2041 ADD_BITFIELD_RW(GPIO8_EDGE_HIGH, 3, 1)
2042 ADD_BITFIELD_RW(GPIO8_EDGE_LOW, 2, 1)
2043 ADD_BITFIELD_RW(GPIO8_LEVEL_HIGH, 1, 1)
2044 ADD_BITFIELD_RW(GPIO8_LEVEL_LOW, 0, 1)
2045 END_TYPE()
2046
2047 // Interrupt Force for proc0
2048 // Reset value: 0x00000000
2049 BEGIN_TYPE(PROC0_INTF2_t, uint32_t)
2050 ADD_BITFIELD_RW(GPIO23_EDGE_HIGH, 31, 1)
2051 ADD_BITFIELD_RW(GPIO23_EDGE_LOW, 30, 1)
2052 ADD_BITFIELD_RW(GPIO23_LEVEL_HIGH, 29, 1)
2053 ADD_BITFIELD_RW(GPIO23_LEVEL_LOW, 28, 1)
2054 ADD_BITFIELD_RW(GPIO22_EDGE_HIGH, 27, 1)
2055 ADD_BITFIELD_RW(GPIO22_EDGE_LOW, 26, 1)
2056 ADD_BITFIELD_RW(GPIO22_LEVEL_HIGH, 25, 1)
2057 ADD_BITFIELD_RW(GPIO22_LEVEL_LOW, 24, 1)
2058 ADD_BITFIELD_RW(GPIO21_EDGE_HIGH, 23, 1)
2059 ADD_BITFIELD_RW(GPIO21_EDGE_LOW, 22, 1)
2060 ADD_BITFIELD_RW(GPIO21_LEVEL_HIGH, 21, 1)
2061 ADD_BITFIELD_RW(GPIO21_LEVEL_LOW, 20, 1)
2062 ADD_BITFIELD_RW(GPIO20_EDGE_HIGH, 19, 1)
2063 ADD_BITFIELD_RW(GPIO20_EDGE_LOW, 18, 1)
2064 ADD_BITFIELD_RW(GPIO20_LEVEL_HIGH, 17, 1)
2065 ADD_BITFIELD_RW(GPIO20_LEVEL_LOW, 16, 1)
2066 ADD_BITFIELD_RW(GPIO19_EDGE_HIGH, 15, 1)
2067 ADD_BITFIELD_RW(GPIO19_EDGE_LOW, 14, 1)
2068 ADD_BITFIELD_RW(GPIO19_LEVEL_HIGH, 13, 1)
2069 ADD_BITFIELD_RW(GPIO19_LEVEL_LOW, 12, 1)
2070 ADD_BITFIELD_RW(GPIO18_EDGE_HIGH, 11, 1)
2071 ADD_BITFIELD_RW(GPIO18_EDGE_LOW, 10, 1)
2072 ADD_BITFIELD_RW(GPIO18_LEVEL_HIGH, 9, 1)
2073 ADD_BITFIELD_RW(GPIO18_LEVEL_LOW, 8, 1)
2074 ADD_BITFIELD_RW(GPIO17_EDGE_HIGH, 7, 1)
2075 ADD_BITFIELD_RW(GPIO17_EDGE_LOW, 6, 1)
2076 ADD_BITFIELD_RW(GPIO17_LEVEL_HIGH, 5, 1)
2077 ADD_BITFIELD_RW(GPIO17_LEVEL_LOW, 4, 1)
2078 ADD_BITFIELD_RW(GPIO16_EDGE_HIGH, 3, 1)
2079 ADD_BITFIELD_RW(GPIO16_EDGE_LOW, 2, 1)
2080 ADD_BITFIELD_RW(GPIO16_LEVEL_HIGH, 1, 1)
2081 ADD_BITFIELD_RW(GPIO16_LEVEL_LOW, 0, 1)
2082 END_TYPE()
2083
2084 // Interrupt Force for proc0
2085 // Reset value: 0x00000000
2086 BEGIN_TYPE(PROC0_INTF3_t, uint32_t)
2087 ADD_BITFIELD_RW(GPIO29_EDGE_HIGH, 23, 1)
2088 ADD_BITFIELD_RW(GPIO29_EDGE_LOW, 22, 1)
2089 ADD_BITFIELD_RW(GPIO29_LEVEL_HIGH, 21, 1)
2090 ADD_BITFIELD_RW(GPIO29_LEVEL_LOW, 20, 1)
2091 ADD_BITFIELD_RW(GPIO28_EDGE_HIGH, 19, 1)
2092 ADD_BITFIELD_RW(GPIO28_EDGE_LOW, 18, 1)
2093 ADD_BITFIELD_RW(GPIO28_LEVEL_HIGH, 17, 1)
2094 ADD_BITFIELD_RW(GPIO28_LEVEL_LOW, 16, 1)
2095 ADD_BITFIELD_RW(GPIO27_EDGE_HIGH, 15, 1)
2096 ADD_BITFIELD_RW(GPIO27_EDGE_LOW, 14, 1)
2097 ADD_BITFIELD_RW(GPIO27_LEVEL_HIGH, 13, 1)
2098 ADD_BITFIELD_RW(GPIO27_LEVEL_LOW, 12, 1)
2099 ADD_BITFIELD_RW(GPIO26_EDGE_HIGH, 11, 1)
2100 ADD_BITFIELD_RW(GPIO26_EDGE_LOW, 10, 1)
2101 ADD_BITFIELD_RW(GPIO26_LEVEL_HIGH, 9, 1)
2102 ADD_BITFIELD_RW(GPIO26_LEVEL_LOW, 8, 1)
2103 ADD_BITFIELD_RW(GPIO25_EDGE_HIGH, 7, 1)
2104 ADD_BITFIELD_RW(GPIO25_EDGE_LOW, 6, 1)
2105 ADD_BITFIELD_RW(GPIO25_LEVEL_HIGH, 5, 1)
2106 ADD_BITFIELD_RW(GPIO25_LEVEL_LOW, 4, 1)
2107 ADD_BITFIELD_RW(GPIO24_EDGE_HIGH, 3, 1)
2108 ADD_BITFIELD_RW(GPIO24_EDGE_LOW, 2, 1)
2109 ADD_BITFIELD_RW(GPIO24_LEVEL_HIGH, 1, 1)
2110 ADD_BITFIELD_RW(GPIO24_LEVEL_LOW, 0, 1)
2111 END_TYPE()
2112
2113 // Interrupt status after masking & forcing for proc0
2114 // Reset value: 0x00000000
2115 BEGIN_TYPE(PROC0_INTS0_t, uint32_t)
2116 ADD_BITFIELD_RO(GPIO7_EDGE_HIGH, 31, 1)
2117 ADD_BITFIELD_RO(GPIO7_EDGE_LOW, 30, 1)
2118 ADD_BITFIELD_RO(GPIO7_LEVEL_HIGH, 29, 1)
2119 ADD_BITFIELD_RO(GPIO7_LEVEL_LOW, 28, 1)
2120 ADD_BITFIELD_RO(GPIO6_EDGE_HIGH, 27, 1)
2121 ADD_BITFIELD_RO(GPIO6_EDGE_LOW, 26, 1)
2122 ADD_BITFIELD_RO(GPIO6_LEVEL_HIGH, 25, 1)
2123 ADD_BITFIELD_RO(GPIO6_LEVEL_LOW, 24, 1)
2124 ADD_BITFIELD_RO(GPIO5_EDGE_HIGH, 23, 1)
2125 ADD_BITFIELD_RO(GPIO5_EDGE_LOW, 22, 1)
2126 ADD_BITFIELD_RO(GPIO5_LEVEL_HIGH, 21, 1)
2127 ADD_BITFIELD_RO(GPIO5_LEVEL_LOW, 20, 1)
2128 ADD_BITFIELD_RO(GPIO4_EDGE_HIGH, 19, 1)
2129 ADD_BITFIELD_RO(GPIO4_EDGE_LOW, 18, 1)
2130 ADD_BITFIELD_RO(GPIO4_LEVEL_HIGH, 17, 1)
2131 ADD_BITFIELD_RO(GPIO4_LEVEL_LOW, 16, 1)
2132 ADD_BITFIELD_RO(GPIO3_EDGE_HIGH, 15, 1)
2133 ADD_BITFIELD_RO(GPIO3_EDGE_LOW, 14, 1)
2134 ADD_BITFIELD_RO(GPIO3_LEVEL_HIGH, 13, 1)
2135 ADD_BITFIELD_RO(GPIO3_LEVEL_LOW, 12, 1)
2136 ADD_BITFIELD_RO(GPIO2_EDGE_HIGH, 11, 1)
2137 ADD_BITFIELD_RO(GPIO2_EDGE_LOW, 10, 1)
2138 ADD_BITFIELD_RO(GPIO2_LEVEL_HIGH, 9, 1)
2139 ADD_BITFIELD_RO(GPIO2_LEVEL_LOW, 8, 1)
2140 ADD_BITFIELD_RO(GPIO1_EDGE_HIGH, 7, 1)
2141 ADD_BITFIELD_RO(GPIO1_EDGE_LOW, 6, 1)
2142 ADD_BITFIELD_RO(GPIO1_LEVEL_HIGH, 5, 1)
2143 ADD_BITFIELD_RO(GPIO1_LEVEL_LOW, 4, 1)
2144 ADD_BITFIELD_RO(GPIO0_EDGE_HIGH, 3, 1)
2145 ADD_BITFIELD_RO(GPIO0_EDGE_LOW, 2, 1)
2146 ADD_BITFIELD_RO(GPIO0_LEVEL_HIGH, 1, 1)
2147 ADD_BITFIELD_RO(GPIO0_LEVEL_LOW, 0, 1)
2148 END_TYPE()
2149
2150 // Interrupt status after masking & forcing for proc0
2151 // Reset value: 0x00000000
2152 BEGIN_TYPE(PROC0_INTS1_t, uint32_t)
2153 ADD_BITFIELD_RO(GPIO15_EDGE_HIGH, 31, 1)
2154 ADD_BITFIELD_RO(GPIO15_EDGE_LOW, 30, 1)
2155 ADD_BITFIELD_RO(GPIO15_LEVEL_HIGH, 29, 1)
2156 ADD_BITFIELD_RO(GPIO15_LEVEL_LOW, 28, 1)
2157 ADD_BITFIELD_RO(GPIO14_EDGE_HIGH, 27, 1)
2158 ADD_BITFIELD_RO(GPIO14_EDGE_LOW, 26, 1)
2159 ADD_BITFIELD_RO(GPIO14_LEVEL_HIGH, 25, 1)
2160 ADD_BITFIELD_RO(GPIO14_LEVEL_LOW, 24, 1)
2161 ADD_BITFIELD_RO(GPIO13_EDGE_HIGH, 23, 1)
2162 ADD_BITFIELD_RO(GPIO13_EDGE_LOW, 22, 1)
2163 ADD_BITFIELD_RO(GPIO13_LEVEL_HIGH, 21, 1)
2164 ADD_BITFIELD_RO(GPIO13_LEVEL_LOW, 20, 1)
2165 ADD_BITFIELD_RO(GPIO12_EDGE_HIGH, 19, 1)
2166 ADD_BITFIELD_RO(GPIO12_EDGE_LOW, 18, 1)
2167 ADD_BITFIELD_RO(GPIO12_LEVEL_HIGH, 17, 1)
2168 ADD_BITFIELD_RO(GPIO12_LEVEL_LOW, 16, 1)
2169 ADD_BITFIELD_RO(GPIO11_EDGE_HIGH, 15, 1)
2170 ADD_BITFIELD_RO(GPIO11_EDGE_LOW, 14, 1)
2171 ADD_BITFIELD_RO(GPIO11_LEVEL_HIGH, 13, 1)
2172 ADD_BITFIELD_RO(GPIO11_LEVEL_LOW, 12, 1)
2173 ADD_BITFIELD_RO(GPIO10_EDGE_HIGH, 11, 1)
2174 ADD_BITFIELD_RO(GPIO10_EDGE_LOW, 10, 1)
2175 ADD_BITFIELD_RO(GPIO10_LEVEL_HIGH, 9, 1)
2176 ADD_BITFIELD_RO(GPIO10_LEVEL_LOW, 8, 1)
2177 ADD_BITFIELD_RO(GPIO9_EDGE_HIGH, 7, 1)
2178 ADD_BITFIELD_RO(GPIO9_EDGE_LOW, 6, 1)
2179 ADD_BITFIELD_RO(GPIO9_LEVEL_HIGH, 5, 1)
2180 ADD_BITFIELD_RO(GPIO9_LEVEL_LOW, 4, 1)
2181 ADD_BITFIELD_RO(GPIO8_EDGE_HIGH, 3, 1)
2182 ADD_BITFIELD_RO(GPIO8_EDGE_LOW, 2, 1)
2183 ADD_BITFIELD_RO(GPIO8_LEVEL_HIGH, 1, 1)
2184 ADD_BITFIELD_RO(GPIO8_LEVEL_LOW, 0, 1)
2185 END_TYPE()
2186
2187 // Interrupt status after masking & forcing for proc0
2188 // Reset value: 0x00000000
2189 BEGIN_TYPE(PROC0_INTS2_t, uint32_t)
2190 ADD_BITFIELD_RO(GPIO23_EDGE_HIGH, 31, 1)
2191 ADD_BITFIELD_RO(GPIO23_EDGE_LOW, 30, 1)
2192 ADD_BITFIELD_RO(GPIO23_LEVEL_HIGH, 29, 1)
2193 ADD_BITFIELD_RO(GPIO23_LEVEL_LOW, 28, 1)
2194 ADD_BITFIELD_RO(GPIO22_EDGE_HIGH, 27, 1)
2195 ADD_BITFIELD_RO(GPIO22_EDGE_LOW, 26, 1)
2196 ADD_BITFIELD_RO(GPIO22_LEVEL_HIGH, 25, 1)
2197 ADD_BITFIELD_RO(GPIO22_LEVEL_LOW, 24, 1)
2198 ADD_BITFIELD_RO(GPIO21_EDGE_HIGH, 23, 1)
2199 ADD_BITFIELD_RO(GPIO21_EDGE_LOW, 22, 1)
2200 ADD_BITFIELD_RO(GPIO21_LEVEL_HIGH, 21, 1)
2201 ADD_BITFIELD_RO(GPIO21_LEVEL_LOW, 20, 1)
2202 ADD_BITFIELD_RO(GPIO20_EDGE_HIGH, 19, 1)
2203 ADD_BITFIELD_RO(GPIO20_EDGE_LOW, 18, 1)
2204 ADD_BITFIELD_RO(GPIO20_LEVEL_HIGH, 17, 1)
2205 ADD_BITFIELD_RO(GPIO20_LEVEL_LOW, 16, 1)
2206 ADD_BITFIELD_RO(GPIO19_EDGE_HIGH, 15, 1)
2207 ADD_BITFIELD_RO(GPIO19_EDGE_LOW, 14, 1)
2208 ADD_BITFIELD_RO(GPIO19_LEVEL_HIGH, 13, 1)
2209 ADD_BITFIELD_RO(GPIO19_LEVEL_LOW, 12, 1)
2210 ADD_BITFIELD_RO(GPIO18_EDGE_HIGH, 11, 1)
2211 ADD_BITFIELD_RO(GPIO18_EDGE_LOW, 10, 1)
2212 ADD_BITFIELD_RO(GPIO18_LEVEL_HIGH, 9, 1)
2213 ADD_BITFIELD_RO(GPIO18_LEVEL_LOW, 8, 1)
2214 ADD_BITFIELD_RO(GPIO17_EDGE_HIGH, 7, 1)
2215 ADD_BITFIELD_RO(GPIO17_EDGE_LOW, 6, 1)
2216 ADD_BITFIELD_RO(GPIO17_LEVEL_HIGH, 5, 1)
2217 ADD_BITFIELD_RO(GPIO17_LEVEL_LOW, 4, 1)
2218 ADD_BITFIELD_RO(GPIO16_EDGE_HIGH, 3, 1)
2219 ADD_BITFIELD_RO(GPIO16_EDGE_LOW, 2, 1)
2220 ADD_BITFIELD_RO(GPIO16_LEVEL_HIGH, 1, 1)
2221 ADD_BITFIELD_RO(GPIO16_LEVEL_LOW, 0, 1)
2222 END_TYPE()
2223
2224 // Interrupt status after masking & forcing for proc0
2225 // Reset value: 0x00000000
2226 BEGIN_TYPE(PROC0_INTS3_t, uint32_t)
2227 ADD_BITFIELD_RO(GPIO29_EDGE_HIGH, 23, 1)
2228 ADD_BITFIELD_RO(GPIO29_EDGE_LOW, 22, 1)
2229 ADD_BITFIELD_RO(GPIO29_LEVEL_HIGH, 21, 1)
2230 ADD_BITFIELD_RO(GPIO29_LEVEL_LOW, 20, 1)
2231 ADD_BITFIELD_RO(GPIO28_EDGE_HIGH, 19, 1)
2232 ADD_BITFIELD_RO(GPIO28_EDGE_LOW, 18, 1)
2233 ADD_BITFIELD_RO(GPIO28_LEVEL_HIGH, 17, 1)
2234 ADD_BITFIELD_RO(GPIO28_LEVEL_LOW, 16, 1)
2235 ADD_BITFIELD_RO(GPIO27_EDGE_HIGH, 15, 1)
2236 ADD_BITFIELD_RO(GPIO27_EDGE_LOW, 14, 1)
2237 ADD_BITFIELD_RO(GPIO27_LEVEL_HIGH, 13, 1)
2238 ADD_BITFIELD_RO(GPIO27_LEVEL_LOW, 12, 1)
2239 ADD_BITFIELD_RO(GPIO26_EDGE_HIGH, 11, 1)
2240 ADD_BITFIELD_RO(GPIO26_EDGE_LOW, 10, 1)
2241 ADD_BITFIELD_RO(GPIO26_LEVEL_HIGH, 9, 1)
2242 ADD_BITFIELD_RO(GPIO26_LEVEL_LOW, 8, 1)
2243 ADD_BITFIELD_RO(GPIO25_EDGE_HIGH, 7, 1)
2244 ADD_BITFIELD_RO(GPIO25_EDGE_LOW, 6, 1)
2245 ADD_BITFIELD_RO(GPIO25_LEVEL_HIGH, 5, 1)
2246 ADD_BITFIELD_RO(GPIO25_LEVEL_LOW, 4, 1)
2247 ADD_BITFIELD_RO(GPIO24_EDGE_HIGH, 3, 1)
2248 ADD_BITFIELD_RO(GPIO24_EDGE_LOW, 2, 1)
2249 ADD_BITFIELD_RO(GPIO24_LEVEL_HIGH, 1, 1)
2250 ADD_BITFIELD_RO(GPIO24_LEVEL_LOW, 0, 1)
2251 END_TYPE()
2252
2253 // Interrupt Enable for proc1
2254 // Reset value: 0x00000000
2255 BEGIN_TYPE(PROC1_INTE0_t, uint32_t)
2256 ADD_BITFIELD_RW(GPIO7_EDGE_HIGH, 31, 1)
2257 ADD_BITFIELD_RW(GPIO7_EDGE_LOW, 30, 1)
2258 ADD_BITFIELD_RW(GPIO7_LEVEL_HIGH, 29, 1)
2259 ADD_BITFIELD_RW(GPIO7_LEVEL_LOW, 28, 1)
2260 ADD_BITFIELD_RW(GPIO6_EDGE_HIGH, 27, 1)
2261 ADD_BITFIELD_RW(GPIO6_EDGE_LOW, 26, 1)
2262 ADD_BITFIELD_RW(GPIO6_LEVEL_HIGH, 25, 1)
2263 ADD_BITFIELD_RW(GPIO6_LEVEL_LOW, 24, 1)
2264 ADD_BITFIELD_RW(GPIO5_EDGE_HIGH, 23, 1)
2265 ADD_BITFIELD_RW(GPIO5_EDGE_LOW, 22, 1)
2266 ADD_BITFIELD_RW(GPIO5_LEVEL_HIGH, 21, 1)
2267 ADD_BITFIELD_RW(GPIO5_LEVEL_LOW, 20, 1)
2268 ADD_BITFIELD_RW(GPIO4_EDGE_HIGH, 19, 1)
2269 ADD_BITFIELD_RW(GPIO4_EDGE_LOW, 18, 1)
2270 ADD_BITFIELD_RW(GPIO4_LEVEL_HIGH, 17, 1)
2271 ADD_BITFIELD_RW(GPIO4_LEVEL_LOW, 16, 1)
2272 ADD_BITFIELD_RW(GPIO3_EDGE_HIGH, 15, 1)
2273 ADD_BITFIELD_RW(GPIO3_EDGE_LOW, 14, 1)
2274 ADD_BITFIELD_RW(GPIO3_LEVEL_HIGH, 13, 1)
2275 ADD_BITFIELD_RW(GPIO3_LEVEL_LOW, 12, 1)
2276 ADD_BITFIELD_RW(GPIO2_EDGE_HIGH, 11, 1)
2277 ADD_BITFIELD_RW(GPIO2_EDGE_LOW, 10, 1)
2278 ADD_BITFIELD_RW(GPIO2_LEVEL_HIGH, 9, 1)
2279 ADD_BITFIELD_RW(GPIO2_LEVEL_LOW, 8, 1)
2280 ADD_BITFIELD_RW(GPIO1_EDGE_HIGH, 7, 1)
2281 ADD_BITFIELD_RW(GPIO1_EDGE_LOW, 6, 1)
2282 ADD_BITFIELD_RW(GPIO1_LEVEL_HIGH, 5, 1)
2283 ADD_BITFIELD_RW(GPIO1_LEVEL_LOW, 4, 1)
2284 ADD_BITFIELD_RW(GPIO0_EDGE_HIGH, 3, 1)
2285 ADD_BITFIELD_RW(GPIO0_EDGE_LOW, 2, 1)
2286 ADD_BITFIELD_RW(GPIO0_LEVEL_HIGH, 1, 1)
2287 ADD_BITFIELD_RW(GPIO0_LEVEL_LOW, 0, 1)
2288 END_TYPE()
2289
2290 // Interrupt Enable for proc1
2291 // Reset value: 0x00000000
2292 BEGIN_TYPE(PROC1_INTE1_t, uint32_t)
2293 ADD_BITFIELD_RW(GPIO15_EDGE_HIGH, 31, 1)
2294 ADD_BITFIELD_RW(GPIO15_EDGE_LOW, 30, 1)
2295 ADD_BITFIELD_RW(GPIO15_LEVEL_HIGH, 29, 1)
2296 ADD_BITFIELD_RW(GPIO15_LEVEL_LOW, 28, 1)
2297 ADD_BITFIELD_RW(GPIO14_EDGE_HIGH, 27, 1)
2298 ADD_BITFIELD_RW(GPIO14_EDGE_LOW, 26, 1)
2299 ADD_BITFIELD_RW(GPIO14_LEVEL_HIGH, 25, 1)
2300 ADD_BITFIELD_RW(GPIO14_LEVEL_LOW, 24, 1)
2301 ADD_BITFIELD_RW(GPIO13_EDGE_HIGH, 23, 1)
2302 ADD_BITFIELD_RW(GPIO13_EDGE_LOW, 22, 1)
2303 ADD_BITFIELD_RW(GPIO13_LEVEL_HIGH, 21, 1)
2304 ADD_BITFIELD_RW(GPIO13_LEVEL_LOW, 20, 1)
2305 ADD_BITFIELD_RW(GPIO12_EDGE_HIGH, 19, 1)
2306 ADD_BITFIELD_RW(GPIO12_EDGE_LOW, 18, 1)
2307 ADD_BITFIELD_RW(GPIO12_LEVEL_HIGH, 17, 1)
2308 ADD_BITFIELD_RW(GPIO12_LEVEL_LOW, 16, 1)
2309 ADD_BITFIELD_RW(GPIO11_EDGE_HIGH, 15, 1)
2310 ADD_BITFIELD_RW(GPIO11_EDGE_LOW, 14, 1)
2311 ADD_BITFIELD_RW(GPIO11_LEVEL_HIGH, 13, 1)
2312 ADD_BITFIELD_RW(GPIO11_LEVEL_LOW, 12, 1)
2313 ADD_BITFIELD_RW(GPIO10_EDGE_HIGH, 11, 1)
2314 ADD_BITFIELD_RW(GPIO10_EDGE_LOW, 10, 1)
2315 ADD_BITFIELD_RW(GPIO10_LEVEL_HIGH, 9, 1)
2316 ADD_BITFIELD_RW(GPIO10_LEVEL_LOW, 8, 1)
2317 ADD_BITFIELD_RW(GPIO9_EDGE_HIGH, 7, 1)
2318 ADD_BITFIELD_RW(GPIO9_EDGE_LOW, 6, 1)
2319 ADD_BITFIELD_RW(GPIO9_LEVEL_HIGH, 5, 1)
2320 ADD_BITFIELD_RW(GPIO9_LEVEL_LOW, 4, 1)
2321 ADD_BITFIELD_RW(GPIO8_EDGE_HIGH, 3, 1)
2322 ADD_BITFIELD_RW(GPIO8_EDGE_LOW, 2, 1)
2323 ADD_BITFIELD_RW(GPIO8_LEVEL_HIGH, 1, 1)
2324 ADD_BITFIELD_RW(GPIO8_LEVEL_LOW, 0, 1)
2325 END_TYPE()
2326
2327 // Interrupt Enable for proc1
2328 // Reset value: 0x00000000
2329 BEGIN_TYPE(PROC1_INTE2_t, uint32_t)
2330 ADD_BITFIELD_RW(GPIO23_EDGE_HIGH, 31, 1)
2331 ADD_BITFIELD_RW(GPIO23_EDGE_LOW, 30, 1)
2332 ADD_BITFIELD_RW(GPIO23_LEVEL_HIGH, 29, 1)
2333 ADD_BITFIELD_RW(GPIO23_LEVEL_LOW, 28, 1)
2334 ADD_BITFIELD_RW(GPIO22_EDGE_HIGH, 27, 1)
2335 ADD_BITFIELD_RW(GPIO22_EDGE_LOW, 26, 1)
2336 ADD_BITFIELD_RW(GPIO22_LEVEL_HIGH, 25, 1)
2337 ADD_BITFIELD_RW(GPIO22_LEVEL_LOW, 24, 1)
2338 ADD_BITFIELD_RW(GPIO21_EDGE_HIGH, 23, 1)
2339 ADD_BITFIELD_RW(GPIO21_EDGE_LOW, 22, 1)
2340 ADD_BITFIELD_RW(GPIO21_LEVEL_HIGH, 21, 1)
2341 ADD_BITFIELD_RW(GPIO21_LEVEL_LOW, 20, 1)
2342 ADD_BITFIELD_RW(GPIO20_EDGE_HIGH, 19, 1)
2343 ADD_BITFIELD_RW(GPIO20_EDGE_LOW, 18, 1)
2344 ADD_BITFIELD_RW(GPIO20_LEVEL_HIGH, 17, 1)
2345 ADD_BITFIELD_RW(GPIO20_LEVEL_LOW, 16, 1)
2346 ADD_BITFIELD_RW(GPIO19_EDGE_HIGH, 15, 1)
2347 ADD_BITFIELD_RW(GPIO19_EDGE_LOW, 14, 1)
2348 ADD_BITFIELD_RW(GPIO19_LEVEL_HIGH, 13, 1)
2349 ADD_BITFIELD_RW(GPIO19_LEVEL_LOW, 12, 1)
2350 ADD_BITFIELD_RW(GPIO18_EDGE_HIGH, 11, 1)
2351 ADD_BITFIELD_RW(GPIO18_EDGE_LOW, 10, 1)
2352 ADD_BITFIELD_RW(GPIO18_LEVEL_HIGH, 9, 1)
2353 ADD_BITFIELD_RW(GPIO18_LEVEL_LOW, 8, 1)
2354 ADD_BITFIELD_RW(GPIO17_EDGE_HIGH, 7, 1)
2355 ADD_BITFIELD_RW(GPIO17_EDGE_LOW, 6, 1)
2356 ADD_BITFIELD_RW(GPIO17_LEVEL_HIGH, 5, 1)
2357 ADD_BITFIELD_RW(GPIO17_LEVEL_LOW, 4, 1)
2358 ADD_BITFIELD_RW(GPIO16_EDGE_HIGH, 3, 1)
2359 ADD_BITFIELD_RW(GPIO16_EDGE_LOW, 2, 1)
2360 ADD_BITFIELD_RW(GPIO16_LEVEL_HIGH, 1, 1)
2361 ADD_BITFIELD_RW(GPIO16_LEVEL_LOW, 0, 1)
2362 END_TYPE()
2363
2364 // Interrupt Enable for proc1
2365 // Reset value: 0x00000000
2366 BEGIN_TYPE(PROC1_INTE3_t, uint32_t)
2367 ADD_BITFIELD_RW(GPIO29_EDGE_HIGH, 23, 1)
2368 ADD_BITFIELD_RW(GPIO29_EDGE_LOW, 22, 1)
2369 ADD_BITFIELD_RW(GPIO29_LEVEL_HIGH, 21, 1)
2370 ADD_BITFIELD_RW(GPIO29_LEVEL_LOW, 20, 1)
2371 ADD_BITFIELD_RW(GPIO28_EDGE_HIGH, 19, 1)
2372 ADD_BITFIELD_RW(GPIO28_EDGE_LOW, 18, 1)
2373 ADD_BITFIELD_RW(GPIO28_LEVEL_HIGH, 17, 1)
2374 ADD_BITFIELD_RW(GPIO28_LEVEL_LOW, 16, 1)
2375 ADD_BITFIELD_RW(GPIO27_EDGE_HIGH, 15, 1)
2376 ADD_BITFIELD_RW(GPIO27_EDGE_LOW, 14, 1)
2377 ADD_BITFIELD_RW(GPIO27_LEVEL_HIGH, 13, 1)
2378 ADD_BITFIELD_RW(GPIO27_LEVEL_LOW, 12, 1)
2379 ADD_BITFIELD_RW(GPIO26_EDGE_HIGH, 11, 1)
2380 ADD_BITFIELD_RW(GPIO26_EDGE_LOW, 10, 1)
2381 ADD_BITFIELD_RW(GPIO26_LEVEL_HIGH, 9, 1)
2382 ADD_BITFIELD_RW(GPIO26_LEVEL_LOW, 8, 1)
2383 ADD_BITFIELD_RW(GPIO25_EDGE_HIGH, 7, 1)
2384 ADD_BITFIELD_RW(GPIO25_EDGE_LOW, 6, 1)
2385 ADD_BITFIELD_RW(GPIO25_LEVEL_HIGH, 5, 1)
2386 ADD_BITFIELD_RW(GPIO25_LEVEL_LOW, 4, 1)
2387 ADD_BITFIELD_RW(GPIO24_EDGE_HIGH, 3, 1)
2388 ADD_BITFIELD_RW(GPIO24_EDGE_LOW, 2, 1)
2389 ADD_BITFIELD_RW(GPIO24_LEVEL_HIGH, 1, 1)
2390 ADD_BITFIELD_RW(GPIO24_LEVEL_LOW, 0, 1)
2391 END_TYPE()
2392
2393 // Interrupt Force for proc1
2394 // Reset value: 0x00000000
2395 BEGIN_TYPE(PROC1_INTF0_t, uint32_t)
2396 ADD_BITFIELD_RW(GPIO7_EDGE_HIGH, 31, 1)
2397 ADD_BITFIELD_RW(GPIO7_EDGE_LOW, 30, 1)
2398 ADD_BITFIELD_RW(GPIO7_LEVEL_HIGH, 29, 1)
2399 ADD_BITFIELD_RW(GPIO7_LEVEL_LOW, 28, 1)
2400 ADD_BITFIELD_RW(GPIO6_EDGE_HIGH, 27, 1)
2401 ADD_BITFIELD_RW(GPIO6_EDGE_LOW, 26, 1)
2402 ADD_BITFIELD_RW(GPIO6_LEVEL_HIGH, 25, 1)
2403 ADD_BITFIELD_RW(GPIO6_LEVEL_LOW, 24, 1)
2404 ADD_BITFIELD_RW(GPIO5_EDGE_HIGH, 23, 1)
2405 ADD_BITFIELD_RW(GPIO5_EDGE_LOW, 22, 1)
2406 ADD_BITFIELD_RW(GPIO5_LEVEL_HIGH, 21, 1)
2407 ADD_BITFIELD_RW(GPIO5_LEVEL_LOW, 20, 1)
2408 ADD_BITFIELD_RW(GPIO4_EDGE_HIGH, 19, 1)
2409 ADD_BITFIELD_RW(GPIO4_EDGE_LOW, 18, 1)
2410 ADD_BITFIELD_RW(GPIO4_LEVEL_HIGH, 17, 1)
2411 ADD_BITFIELD_RW(GPIO4_LEVEL_LOW, 16, 1)
2412 ADD_BITFIELD_RW(GPIO3_EDGE_HIGH, 15, 1)
2413 ADD_BITFIELD_RW(GPIO3_EDGE_LOW, 14, 1)
2414 ADD_BITFIELD_RW(GPIO3_LEVEL_HIGH, 13, 1)
2415 ADD_BITFIELD_RW(GPIO3_LEVEL_LOW, 12, 1)
2416 ADD_BITFIELD_RW(GPIO2_EDGE_HIGH, 11, 1)
2417 ADD_BITFIELD_RW(GPIO2_EDGE_LOW, 10, 1)
2418 ADD_BITFIELD_RW(GPIO2_LEVEL_HIGH, 9, 1)
2419 ADD_BITFIELD_RW(GPIO2_LEVEL_LOW, 8, 1)
2420 ADD_BITFIELD_RW(GPIO1_EDGE_HIGH, 7, 1)
2421 ADD_BITFIELD_RW(GPIO1_EDGE_LOW, 6, 1)
2422 ADD_BITFIELD_RW(GPIO1_LEVEL_HIGH, 5, 1)
2423 ADD_BITFIELD_RW(GPIO1_LEVEL_LOW, 4, 1)
2424 ADD_BITFIELD_RW(GPIO0_EDGE_HIGH, 3, 1)
2425 ADD_BITFIELD_RW(GPIO0_EDGE_LOW, 2, 1)
2426 ADD_BITFIELD_RW(GPIO0_LEVEL_HIGH, 1, 1)
2427 ADD_BITFIELD_RW(GPIO0_LEVEL_LOW, 0, 1)
2428 END_TYPE()
2429
2430 // Interrupt Force for proc1
2431 // Reset value: 0x00000000
2432 BEGIN_TYPE(PROC1_INTF1_t, uint32_t)
2433 ADD_BITFIELD_RW(GPIO15_EDGE_HIGH, 31, 1)
2434 ADD_BITFIELD_RW(GPIO15_EDGE_LOW, 30, 1)
2435 ADD_BITFIELD_RW(GPIO15_LEVEL_HIGH, 29, 1)
2436 ADD_BITFIELD_RW(GPIO15_LEVEL_LOW, 28, 1)
2437 ADD_BITFIELD_RW(GPIO14_EDGE_HIGH, 27, 1)
2438 ADD_BITFIELD_RW(GPIO14_EDGE_LOW, 26, 1)
2439 ADD_BITFIELD_RW(GPIO14_LEVEL_HIGH, 25, 1)
2440 ADD_BITFIELD_RW(GPIO14_LEVEL_LOW, 24, 1)
2441 ADD_BITFIELD_RW(GPIO13_EDGE_HIGH, 23, 1)
2442 ADD_BITFIELD_RW(GPIO13_EDGE_LOW, 22, 1)
2443 ADD_BITFIELD_RW(GPIO13_LEVEL_HIGH, 21, 1)
2444 ADD_BITFIELD_RW(GPIO13_LEVEL_LOW, 20, 1)
2445 ADD_BITFIELD_RW(GPIO12_EDGE_HIGH, 19, 1)
2446 ADD_BITFIELD_RW(GPIO12_EDGE_LOW, 18, 1)
2447 ADD_BITFIELD_RW(GPIO12_LEVEL_HIGH, 17, 1)
2448 ADD_BITFIELD_RW(GPIO12_LEVEL_LOW, 16, 1)
2449 ADD_BITFIELD_RW(GPIO11_EDGE_HIGH, 15, 1)
2450 ADD_BITFIELD_RW(GPIO11_EDGE_LOW, 14, 1)
2451 ADD_BITFIELD_RW(GPIO11_LEVEL_HIGH, 13, 1)
2452 ADD_BITFIELD_RW(GPIO11_LEVEL_LOW, 12, 1)
2453 ADD_BITFIELD_RW(GPIO10_EDGE_HIGH, 11, 1)
2454 ADD_BITFIELD_RW(GPIO10_EDGE_LOW, 10, 1)
2455 ADD_BITFIELD_RW(GPIO10_LEVEL_HIGH, 9, 1)
2456 ADD_BITFIELD_RW(GPIO10_LEVEL_LOW, 8, 1)
2457 ADD_BITFIELD_RW(GPIO9_EDGE_HIGH, 7, 1)
2458 ADD_BITFIELD_RW(GPIO9_EDGE_LOW, 6, 1)
2459 ADD_BITFIELD_RW(GPIO9_LEVEL_HIGH, 5, 1)
2460 ADD_BITFIELD_RW(GPIO9_LEVEL_LOW, 4, 1)
2461 ADD_BITFIELD_RW(GPIO8_EDGE_HIGH, 3, 1)
2462 ADD_BITFIELD_RW(GPIO8_EDGE_LOW, 2, 1)
2463 ADD_BITFIELD_RW(GPIO8_LEVEL_HIGH, 1, 1)
2464 ADD_BITFIELD_RW(GPIO8_LEVEL_LOW, 0, 1)
2465 END_TYPE()
2466
2467 // Interrupt Force for proc1
2468 // Reset value: 0x00000000
2469 BEGIN_TYPE(PROC1_INTF2_t, uint32_t)
2470 ADD_BITFIELD_RW(GPIO23_EDGE_HIGH, 31, 1)
2471 ADD_BITFIELD_RW(GPIO23_EDGE_LOW, 30, 1)
2472 ADD_BITFIELD_RW(GPIO23_LEVEL_HIGH, 29, 1)
2473 ADD_BITFIELD_RW(GPIO23_LEVEL_LOW, 28, 1)
2474 ADD_BITFIELD_RW(GPIO22_EDGE_HIGH, 27, 1)
2475 ADD_BITFIELD_RW(GPIO22_EDGE_LOW, 26, 1)
2476 ADD_BITFIELD_RW(GPIO22_LEVEL_HIGH, 25, 1)
2477 ADD_BITFIELD_RW(GPIO22_LEVEL_LOW, 24, 1)
2478 ADD_BITFIELD_RW(GPIO21_EDGE_HIGH, 23, 1)
2479 ADD_BITFIELD_RW(GPIO21_EDGE_LOW, 22, 1)
2480 ADD_BITFIELD_RW(GPIO21_LEVEL_HIGH, 21, 1)
2481 ADD_BITFIELD_RW(GPIO21_LEVEL_LOW, 20, 1)
2482 ADD_BITFIELD_RW(GPIO20_EDGE_HIGH, 19, 1)
2483 ADD_BITFIELD_RW(GPIO20_EDGE_LOW, 18, 1)
2484 ADD_BITFIELD_RW(GPIO20_LEVEL_HIGH, 17, 1)
2485 ADD_BITFIELD_RW(GPIO20_LEVEL_LOW, 16, 1)
2486 ADD_BITFIELD_RW(GPIO19_EDGE_HIGH, 15, 1)
2487 ADD_BITFIELD_RW(GPIO19_EDGE_LOW, 14, 1)
2488 ADD_BITFIELD_RW(GPIO19_LEVEL_HIGH, 13, 1)
2489 ADD_BITFIELD_RW(GPIO19_LEVEL_LOW, 12, 1)
2490 ADD_BITFIELD_RW(GPIO18_EDGE_HIGH, 11, 1)
2491 ADD_BITFIELD_RW(GPIO18_EDGE_LOW, 10, 1)
2492 ADD_BITFIELD_RW(GPIO18_LEVEL_HIGH, 9, 1)
2493 ADD_BITFIELD_RW(GPIO18_LEVEL_LOW, 8, 1)
2494 ADD_BITFIELD_RW(GPIO17_EDGE_HIGH, 7, 1)
2495 ADD_BITFIELD_RW(GPIO17_EDGE_LOW, 6, 1)
2496 ADD_BITFIELD_RW(GPIO17_LEVEL_HIGH, 5, 1)
2497 ADD_BITFIELD_RW(GPIO17_LEVEL_LOW, 4, 1)
2498 ADD_BITFIELD_RW(GPIO16_EDGE_HIGH, 3, 1)
2499 ADD_BITFIELD_RW(GPIO16_EDGE_LOW, 2, 1)
2500 ADD_BITFIELD_RW(GPIO16_LEVEL_HIGH, 1, 1)
2501 ADD_BITFIELD_RW(GPIO16_LEVEL_LOW, 0, 1)
2502 END_TYPE()
2503
2504 // Interrupt Force for proc1
2505 // Reset value: 0x00000000
2506 BEGIN_TYPE(PROC1_INTF3_t, uint32_t)
2507 ADD_BITFIELD_RW(GPIO29_EDGE_HIGH, 23, 1)
2508 ADD_BITFIELD_RW(GPIO29_EDGE_LOW, 22, 1)
2509 ADD_BITFIELD_RW(GPIO29_LEVEL_HIGH, 21, 1)
2510 ADD_BITFIELD_RW(GPIO29_LEVEL_LOW, 20, 1)
2511 ADD_BITFIELD_RW(GPIO28_EDGE_HIGH, 19, 1)
2512 ADD_BITFIELD_RW(GPIO28_EDGE_LOW, 18, 1)
2513 ADD_BITFIELD_RW(GPIO28_LEVEL_HIGH, 17, 1)
2514 ADD_BITFIELD_RW(GPIO28_LEVEL_LOW, 16, 1)
2515 ADD_BITFIELD_RW(GPIO27_EDGE_HIGH, 15, 1)
2516 ADD_BITFIELD_RW(GPIO27_EDGE_LOW, 14, 1)
2517 ADD_BITFIELD_RW(GPIO27_LEVEL_HIGH, 13, 1)
2518 ADD_BITFIELD_RW(GPIO27_LEVEL_LOW, 12, 1)
2519 ADD_BITFIELD_RW(GPIO26_EDGE_HIGH, 11, 1)
2520 ADD_BITFIELD_RW(GPIO26_EDGE_LOW, 10, 1)
2521 ADD_BITFIELD_RW(GPIO26_LEVEL_HIGH, 9, 1)
2522 ADD_BITFIELD_RW(GPIO26_LEVEL_LOW, 8, 1)
2523 ADD_BITFIELD_RW(GPIO25_EDGE_HIGH, 7, 1)
2524 ADD_BITFIELD_RW(GPIO25_EDGE_LOW, 6, 1)
2525 ADD_BITFIELD_RW(GPIO25_LEVEL_HIGH, 5, 1)
2526 ADD_BITFIELD_RW(GPIO25_LEVEL_LOW, 4, 1)
2527 ADD_BITFIELD_RW(GPIO24_EDGE_HIGH, 3, 1)
2528 ADD_BITFIELD_RW(GPIO24_EDGE_LOW, 2, 1)
2529 ADD_BITFIELD_RW(GPIO24_LEVEL_HIGH, 1, 1)
2530 ADD_BITFIELD_RW(GPIO24_LEVEL_LOW, 0, 1)
2531 END_TYPE()
2532
2533 // Interrupt status after masking & forcing for proc1
2534 // Reset value: 0x00000000
2535 BEGIN_TYPE(PROC1_INTS0_t, uint32_t)
2536 ADD_BITFIELD_RO(GPIO7_EDGE_HIGH, 31, 1)
2537 ADD_BITFIELD_RO(GPIO7_EDGE_LOW, 30, 1)
2538 ADD_BITFIELD_RO(GPIO7_LEVEL_HIGH, 29, 1)
2539 ADD_BITFIELD_RO(GPIO7_LEVEL_LOW, 28, 1)
2540 ADD_BITFIELD_RO(GPIO6_EDGE_HIGH, 27, 1)
2541 ADD_BITFIELD_RO(GPIO6_EDGE_LOW, 26, 1)
2542 ADD_BITFIELD_RO(GPIO6_LEVEL_HIGH, 25, 1)
2543 ADD_BITFIELD_RO(GPIO6_LEVEL_LOW, 24, 1)
2544 ADD_BITFIELD_RO(GPIO5_EDGE_HIGH, 23, 1)
2545 ADD_BITFIELD_RO(GPIO5_EDGE_LOW, 22, 1)
2546 ADD_BITFIELD_RO(GPIO5_LEVEL_HIGH, 21, 1)
2547 ADD_BITFIELD_RO(GPIO5_LEVEL_LOW, 20, 1)
2548 ADD_BITFIELD_RO(GPIO4_EDGE_HIGH, 19, 1)
2549 ADD_BITFIELD_RO(GPIO4_EDGE_LOW, 18, 1)
2550 ADD_BITFIELD_RO(GPIO4_LEVEL_HIGH, 17, 1)
2551 ADD_BITFIELD_RO(GPIO4_LEVEL_LOW, 16, 1)
2552 ADD_BITFIELD_RO(GPIO3_EDGE_HIGH, 15, 1)
2553 ADD_BITFIELD_RO(GPIO3_EDGE_LOW, 14, 1)
2554 ADD_BITFIELD_RO(GPIO3_LEVEL_HIGH, 13, 1)
2555 ADD_BITFIELD_RO(GPIO3_LEVEL_LOW, 12, 1)
2556 ADD_BITFIELD_RO(GPIO2_EDGE_HIGH, 11, 1)
2557 ADD_BITFIELD_RO(GPIO2_EDGE_LOW, 10, 1)
2558 ADD_BITFIELD_RO(GPIO2_LEVEL_HIGH, 9, 1)
2559 ADD_BITFIELD_RO(GPIO2_LEVEL_LOW, 8, 1)
2560 ADD_BITFIELD_RO(GPIO1_EDGE_HIGH, 7, 1)
2561 ADD_BITFIELD_RO(GPIO1_EDGE_LOW, 6, 1)
2562 ADD_BITFIELD_RO(GPIO1_LEVEL_HIGH, 5, 1)
2563 ADD_BITFIELD_RO(GPIO1_LEVEL_LOW, 4, 1)
2564 ADD_BITFIELD_RO(GPIO0_EDGE_HIGH, 3, 1)
2565 ADD_BITFIELD_RO(GPIO0_EDGE_LOW, 2, 1)
2566 ADD_BITFIELD_RO(GPIO0_LEVEL_HIGH, 1, 1)
2567 ADD_BITFIELD_RO(GPIO0_LEVEL_LOW, 0, 1)
2568 END_TYPE()
2569
2570 // Interrupt status after masking & forcing for proc1
2571 // Reset value: 0x00000000
2572 BEGIN_TYPE(PROC1_INTS1_t, uint32_t)
2573 ADD_BITFIELD_RO(GPIO15_EDGE_HIGH, 31, 1)
2574 ADD_BITFIELD_RO(GPIO15_EDGE_LOW, 30, 1)
2575 ADD_BITFIELD_RO(GPIO15_LEVEL_HIGH, 29, 1)
2576 ADD_BITFIELD_RO(GPIO15_LEVEL_LOW, 28, 1)
2577 ADD_BITFIELD_RO(GPIO14_EDGE_HIGH, 27, 1)
2578 ADD_BITFIELD_RO(GPIO14_EDGE_LOW, 26, 1)
2579 ADD_BITFIELD_RO(GPIO14_LEVEL_HIGH, 25, 1)
2580 ADD_BITFIELD_RO(GPIO14_LEVEL_LOW, 24, 1)
2581 ADD_BITFIELD_RO(GPIO13_EDGE_HIGH, 23, 1)
2582 ADD_BITFIELD_RO(GPIO13_EDGE_LOW, 22, 1)
2583 ADD_BITFIELD_RO(GPIO13_LEVEL_HIGH, 21, 1)
2584 ADD_BITFIELD_RO(GPIO13_LEVEL_LOW, 20, 1)
2585 ADD_BITFIELD_RO(GPIO12_EDGE_HIGH, 19, 1)
2586 ADD_BITFIELD_RO(GPIO12_EDGE_LOW, 18, 1)
2587 ADD_BITFIELD_RO(GPIO12_LEVEL_HIGH, 17, 1)
2588 ADD_BITFIELD_RO(GPIO12_LEVEL_LOW, 16, 1)
2589 ADD_BITFIELD_RO(GPIO11_EDGE_HIGH, 15, 1)
2590 ADD_BITFIELD_RO(GPIO11_EDGE_LOW, 14, 1)
2591 ADD_BITFIELD_RO(GPIO11_LEVEL_HIGH, 13, 1)
2592 ADD_BITFIELD_RO(GPIO11_LEVEL_LOW, 12, 1)
2593 ADD_BITFIELD_RO(GPIO10_EDGE_HIGH, 11, 1)
2594 ADD_BITFIELD_RO(GPIO10_EDGE_LOW, 10, 1)
2595 ADD_BITFIELD_RO(GPIO10_LEVEL_HIGH, 9, 1)
2596 ADD_BITFIELD_RO(GPIO10_LEVEL_LOW, 8, 1)
2597 ADD_BITFIELD_RO(GPIO9_EDGE_HIGH, 7, 1)
2598 ADD_BITFIELD_RO(GPIO9_EDGE_LOW, 6, 1)
2599 ADD_BITFIELD_RO(GPIO9_LEVEL_HIGH, 5, 1)
2600 ADD_BITFIELD_RO(GPIO9_LEVEL_LOW, 4, 1)
2601 ADD_BITFIELD_RO(GPIO8_EDGE_HIGH, 3, 1)
2602 ADD_BITFIELD_RO(GPIO8_EDGE_LOW, 2, 1)
2603 ADD_BITFIELD_RO(GPIO8_LEVEL_HIGH, 1, 1)
2604 ADD_BITFIELD_RO(GPIO8_LEVEL_LOW, 0, 1)
2605 END_TYPE()
2606
2607 // Interrupt status after masking & forcing for proc1
2608 // Reset value: 0x00000000
2609 BEGIN_TYPE(PROC1_INTS2_t, uint32_t)
2610 ADD_BITFIELD_RO(GPIO23_EDGE_HIGH, 31, 1)
2611 ADD_BITFIELD_RO(GPIO23_EDGE_LOW, 30, 1)
2612 ADD_BITFIELD_RO(GPIO23_LEVEL_HIGH, 29, 1)
2613 ADD_BITFIELD_RO(GPIO23_LEVEL_LOW, 28, 1)
2614 ADD_BITFIELD_RO(GPIO22_EDGE_HIGH, 27, 1)
2615 ADD_BITFIELD_RO(GPIO22_EDGE_LOW, 26, 1)
2616 ADD_BITFIELD_RO(GPIO22_LEVEL_HIGH, 25, 1)
2617 ADD_BITFIELD_RO(GPIO22_LEVEL_LOW, 24, 1)
2618 ADD_BITFIELD_RO(GPIO21_EDGE_HIGH, 23, 1)
2619 ADD_BITFIELD_RO(GPIO21_EDGE_LOW, 22, 1)
2620 ADD_BITFIELD_RO(GPIO21_LEVEL_HIGH, 21, 1)
2621 ADD_BITFIELD_RO(GPIO21_LEVEL_LOW, 20, 1)
2622 ADD_BITFIELD_RO(GPIO20_EDGE_HIGH, 19, 1)
2623 ADD_BITFIELD_RO(GPIO20_EDGE_LOW, 18, 1)
2624 ADD_BITFIELD_RO(GPIO20_LEVEL_HIGH, 17, 1)
2625 ADD_BITFIELD_RO(GPIO20_LEVEL_LOW, 16, 1)
2626 ADD_BITFIELD_RO(GPIO19_EDGE_HIGH, 15, 1)
2627 ADD_BITFIELD_RO(GPIO19_EDGE_LOW, 14, 1)
2628 ADD_BITFIELD_RO(GPIO19_LEVEL_HIGH, 13, 1)
2629 ADD_BITFIELD_RO(GPIO19_LEVEL_LOW, 12, 1)
2630 ADD_BITFIELD_RO(GPIO18_EDGE_HIGH, 11, 1)
2631 ADD_BITFIELD_RO(GPIO18_EDGE_LOW, 10, 1)
2632 ADD_BITFIELD_RO(GPIO18_LEVEL_HIGH, 9, 1)
2633 ADD_BITFIELD_RO(GPIO18_LEVEL_LOW, 8, 1)
2634 ADD_BITFIELD_RO(GPIO17_EDGE_HIGH, 7, 1)
2635 ADD_BITFIELD_RO(GPIO17_EDGE_LOW, 6, 1)
2636 ADD_BITFIELD_RO(GPIO17_LEVEL_HIGH, 5, 1)
2637 ADD_BITFIELD_RO(GPIO17_LEVEL_LOW, 4, 1)
2638 ADD_BITFIELD_RO(GPIO16_EDGE_HIGH, 3, 1)
2639 ADD_BITFIELD_RO(GPIO16_EDGE_LOW, 2, 1)
2640 ADD_BITFIELD_RO(GPIO16_LEVEL_HIGH, 1, 1)
2641 ADD_BITFIELD_RO(GPIO16_LEVEL_LOW, 0, 1)
2642 END_TYPE()
2643
2644 // Interrupt status after masking & forcing for proc1
2645 // Reset value: 0x00000000
2646 BEGIN_TYPE(PROC1_INTS3_t, uint32_t)
2647 ADD_BITFIELD_RO(GPIO29_EDGE_HIGH, 23, 1)
2648 ADD_BITFIELD_RO(GPIO29_EDGE_LOW, 22, 1)
2649 ADD_BITFIELD_RO(GPIO29_LEVEL_HIGH, 21, 1)
2650 ADD_BITFIELD_RO(GPIO29_LEVEL_LOW, 20, 1)
2651 ADD_BITFIELD_RO(GPIO28_EDGE_HIGH, 19, 1)
2652 ADD_BITFIELD_RO(GPIO28_EDGE_LOW, 18, 1)
2653 ADD_BITFIELD_RO(GPIO28_LEVEL_HIGH, 17, 1)
2654 ADD_BITFIELD_RO(GPIO28_LEVEL_LOW, 16, 1)
2655 ADD_BITFIELD_RO(GPIO27_EDGE_HIGH, 15, 1)
2656 ADD_BITFIELD_RO(GPIO27_EDGE_LOW, 14, 1)
2657 ADD_BITFIELD_RO(GPIO27_LEVEL_HIGH, 13, 1)
2658 ADD_BITFIELD_RO(GPIO27_LEVEL_LOW, 12, 1)
2659 ADD_BITFIELD_RO(GPIO26_EDGE_HIGH, 11, 1)
2660 ADD_BITFIELD_RO(GPIO26_EDGE_LOW, 10, 1)
2661 ADD_BITFIELD_RO(GPIO26_LEVEL_HIGH, 9, 1)
2662 ADD_BITFIELD_RO(GPIO26_LEVEL_LOW, 8, 1)
2663 ADD_BITFIELD_RO(GPIO25_EDGE_HIGH, 7, 1)
2664 ADD_BITFIELD_RO(GPIO25_EDGE_LOW, 6, 1)
2665 ADD_BITFIELD_RO(GPIO25_LEVEL_HIGH, 5, 1)
2666 ADD_BITFIELD_RO(GPIO25_LEVEL_LOW, 4, 1)
2667 ADD_BITFIELD_RO(GPIO24_EDGE_HIGH, 3, 1)
2668 ADD_BITFIELD_RO(GPIO24_EDGE_LOW, 2, 1)
2669 ADD_BITFIELD_RO(GPIO24_LEVEL_HIGH, 1, 1)
2670 ADD_BITFIELD_RO(GPIO24_LEVEL_LOW, 0, 1)
2671 END_TYPE()
2672
2673 // Interrupt Enable for dormant_wake
2674 // Reset value: 0x00000000
2675 BEGIN_TYPE(DORMANT_WAKE_INTE0_t, uint32_t)
2676 ADD_BITFIELD_RW(GPIO7_EDGE_HIGH, 31, 1)
2677 ADD_BITFIELD_RW(GPIO7_EDGE_LOW, 30, 1)
2678 ADD_BITFIELD_RW(GPIO7_LEVEL_HIGH, 29, 1)
2679 ADD_BITFIELD_RW(GPIO7_LEVEL_LOW, 28, 1)
2680 ADD_BITFIELD_RW(GPIO6_EDGE_HIGH, 27, 1)
2681 ADD_BITFIELD_RW(GPIO6_EDGE_LOW, 26, 1)
2682 ADD_BITFIELD_RW(GPIO6_LEVEL_HIGH, 25, 1)
2683 ADD_BITFIELD_RW(GPIO6_LEVEL_LOW, 24, 1)
2684 ADD_BITFIELD_RW(GPIO5_EDGE_HIGH, 23, 1)
2685 ADD_BITFIELD_RW(GPIO5_EDGE_LOW, 22, 1)
2686 ADD_BITFIELD_RW(GPIO5_LEVEL_HIGH, 21, 1)
2687 ADD_BITFIELD_RW(GPIO5_LEVEL_LOW, 20, 1)
2688 ADD_BITFIELD_RW(GPIO4_EDGE_HIGH, 19, 1)
2689 ADD_BITFIELD_RW(GPIO4_EDGE_LOW, 18, 1)
2690 ADD_BITFIELD_RW(GPIO4_LEVEL_HIGH, 17, 1)
2691 ADD_BITFIELD_RW(GPIO4_LEVEL_LOW, 16, 1)
2692 ADD_BITFIELD_RW(GPIO3_EDGE_HIGH, 15, 1)
2693 ADD_BITFIELD_RW(GPIO3_EDGE_LOW, 14, 1)
2694 ADD_BITFIELD_RW(GPIO3_LEVEL_HIGH, 13, 1)
2695 ADD_BITFIELD_RW(GPIO3_LEVEL_LOW, 12, 1)
2696 ADD_BITFIELD_RW(GPIO2_EDGE_HIGH, 11, 1)
2697 ADD_BITFIELD_RW(GPIO2_EDGE_LOW, 10, 1)
2698 ADD_BITFIELD_RW(GPIO2_LEVEL_HIGH, 9, 1)
2699 ADD_BITFIELD_RW(GPIO2_LEVEL_LOW, 8, 1)
2700 ADD_BITFIELD_RW(GPIO1_EDGE_HIGH, 7, 1)
2701 ADD_BITFIELD_RW(GPIO1_EDGE_LOW, 6, 1)
2702 ADD_BITFIELD_RW(GPIO1_LEVEL_HIGH, 5, 1)
2703 ADD_BITFIELD_RW(GPIO1_LEVEL_LOW, 4, 1)
2704 ADD_BITFIELD_RW(GPIO0_EDGE_HIGH, 3, 1)
2705 ADD_BITFIELD_RW(GPIO0_EDGE_LOW, 2, 1)
2706 ADD_BITFIELD_RW(GPIO0_LEVEL_HIGH, 1, 1)
2707 ADD_BITFIELD_RW(GPIO0_LEVEL_LOW, 0, 1)
2708 END_TYPE()
2709
2710 // Interrupt Enable for dormant_wake
2711 // Reset value: 0x00000000
2712 BEGIN_TYPE(DORMANT_WAKE_INTE1_t, uint32_t)
2713 ADD_BITFIELD_RW(GPIO15_EDGE_HIGH, 31, 1)
2714 ADD_BITFIELD_RW(GPIO15_EDGE_LOW, 30, 1)
2715 ADD_BITFIELD_RW(GPIO15_LEVEL_HIGH, 29, 1)
2716 ADD_BITFIELD_RW(GPIO15_LEVEL_LOW, 28, 1)
2717 ADD_BITFIELD_RW(GPIO14_EDGE_HIGH, 27, 1)
2718 ADD_BITFIELD_RW(GPIO14_EDGE_LOW, 26, 1)
2719 ADD_BITFIELD_RW(GPIO14_LEVEL_HIGH, 25, 1)
2720 ADD_BITFIELD_RW(GPIO14_LEVEL_LOW, 24, 1)
2721 ADD_BITFIELD_RW(GPIO13_EDGE_HIGH, 23, 1)
2722 ADD_BITFIELD_RW(GPIO13_EDGE_LOW, 22, 1)
2723 ADD_BITFIELD_RW(GPIO13_LEVEL_HIGH, 21, 1)
2724 ADD_BITFIELD_RW(GPIO13_LEVEL_LOW, 20, 1)
2725 ADD_BITFIELD_RW(GPIO12_EDGE_HIGH, 19, 1)
2726 ADD_BITFIELD_RW(GPIO12_EDGE_LOW, 18, 1)
2727 ADD_BITFIELD_RW(GPIO12_LEVEL_HIGH, 17, 1)
2728 ADD_BITFIELD_RW(GPIO12_LEVEL_LOW, 16, 1)
2729 ADD_BITFIELD_RW(GPIO11_EDGE_HIGH, 15, 1)
2730 ADD_BITFIELD_RW(GPIO11_EDGE_LOW, 14, 1)
2731 ADD_BITFIELD_RW(GPIO11_LEVEL_HIGH, 13, 1)
2732 ADD_BITFIELD_RW(GPIO11_LEVEL_LOW, 12, 1)
2733 ADD_BITFIELD_RW(GPIO10_EDGE_HIGH, 11, 1)
2734 ADD_BITFIELD_RW(GPIO10_EDGE_LOW, 10, 1)
2735 ADD_BITFIELD_RW(GPIO10_LEVEL_HIGH, 9, 1)
2736 ADD_BITFIELD_RW(GPIO10_LEVEL_LOW, 8, 1)
2737 ADD_BITFIELD_RW(GPIO9_EDGE_HIGH, 7, 1)
2738 ADD_BITFIELD_RW(GPIO9_EDGE_LOW, 6, 1)
2739 ADD_BITFIELD_RW(GPIO9_LEVEL_HIGH, 5, 1)
2740 ADD_BITFIELD_RW(GPIO9_LEVEL_LOW, 4, 1)
2741 ADD_BITFIELD_RW(GPIO8_EDGE_HIGH, 3, 1)
2742 ADD_BITFIELD_RW(GPIO8_EDGE_LOW, 2, 1)
2743 ADD_BITFIELD_RW(GPIO8_LEVEL_HIGH, 1, 1)
2744 ADD_BITFIELD_RW(GPIO8_LEVEL_LOW, 0, 1)
2745 END_TYPE()
2746
2747 // Interrupt Enable for dormant_wake
2748 // Reset value: 0x00000000
2749 BEGIN_TYPE(DORMANT_WAKE_INTE2_t, uint32_t)
2750 ADD_BITFIELD_RW(GPIO23_EDGE_HIGH, 31, 1)
2751 ADD_BITFIELD_RW(GPIO23_EDGE_LOW, 30, 1)
2752 ADD_BITFIELD_RW(GPIO23_LEVEL_HIGH, 29, 1)
2753 ADD_BITFIELD_RW(GPIO23_LEVEL_LOW, 28, 1)
2754 ADD_BITFIELD_RW(GPIO22_EDGE_HIGH, 27, 1)
2755 ADD_BITFIELD_RW(GPIO22_EDGE_LOW, 26, 1)
2756 ADD_BITFIELD_RW(GPIO22_LEVEL_HIGH, 25, 1)
2757 ADD_BITFIELD_RW(GPIO22_LEVEL_LOW, 24, 1)
2758 ADD_BITFIELD_RW(GPIO21_EDGE_HIGH, 23, 1)
2759 ADD_BITFIELD_RW(GPIO21_EDGE_LOW, 22, 1)
2760 ADD_BITFIELD_RW(GPIO21_LEVEL_HIGH, 21, 1)
2761 ADD_BITFIELD_RW(GPIO21_LEVEL_LOW, 20, 1)
2762 ADD_BITFIELD_RW(GPIO20_EDGE_HIGH, 19, 1)
2763 ADD_BITFIELD_RW(GPIO20_EDGE_LOW, 18, 1)
2764 ADD_BITFIELD_RW(GPIO20_LEVEL_HIGH, 17, 1)
2765 ADD_BITFIELD_RW(GPIO20_LEVEL_LOW, 16, 1)
2766 ADD_BITFIELD_RW(GPIO19_EDGE_HIGH, 15, 1)
2767 ADD_BITFIELD_RW(GPIO19_EDGE_LOW, 14, 1)
2768 ADD_BITFIELD_RW(GPIO19_LEVEL_HIGH, 13, 1)
2769 ADD_BITFIELD_RW(GPIO19_LEVEL_LOW, 12, 1)
2770 ADD_BITFIELD_RW(GPIO18_EDGE_HIGH, 11, 1)
2771 ADD_BITFIELD_RW(GPIO18_EDGE_LOW, 10, 1)
2772 ADD_BITFIELD_RW(GPIO18_LEVEL_HIGH, 9, 1)
2773 ADD_BITFIELD_RW(GPIO18_LEVEL_LOW, 8, 1)
2774 ADD_BITFIELD_RW(GPIO17_EDGE_HIGH, 7, 1)
2775 ADD_BITFIELD_RW(GPIO17_EDGE_LOW, 6, 1)
2776 ADD_BITFIELD_RW(GPIO17_LEVEL_HIGH, 5, 1)
2777 ADD_BITFIELD_RW(GPIO17_LEVEL_LOW, 4, 1)
2778 ADD_BITFIELD_RW(GPIO16_EDGE_HIGH, 3, 1)
2779 ADD_BITFIELD_RW(GPIO16_EDGE_LOW, 2, 1)
2780 ADD_BITFIELD_RW(GPIO16_LEVEL_HIGH, 1, 1)
2781 ADD_BITFIELD_RW(GPIO16_LEVEL_LOW, 0, 1)
2782 END_TYPE()
2783
2784 // Interrupt Enable for dormant_wake
2785 // Reset value: 0x00000000
2786 BEGIN_TYPE(DORMANT_WAKE_INTE3_t, uint32_t)
2787 ADD_BITFIELD_RW(GPIO29_EDGE_HIGH, 23, 1)
2788 ADD_BITFIELD_RW(GPIO29_EDGE_LOW, 22, 1)
2789 ADD_BITFIELD_RW(GPIO29_LEVEL_HIGH, 21, 1)
2790 ADD_BITFIELD_RW(GPIO29_LEVEL_LOW, 20, 1)
2791 ADD_BITFIELD_RW(GPIO28_EDGE_HIGH, 19, 1)
2792 ADD_BITFIELD_RW(GPIO28_EDGE_LOW, 18, 1)
2793 ADD_BITFIELD_RW(GPIO28_LEVEL_HIGH, 17, 1)
2794 ADD_BITFIELD_RW(GPIO28_LEVEL_LOW, 16, 1)
2795 ADD_BITFIELD_RW(GPIO27_EDGE_HIGH, 15, 1)
2796 ADD_BITFIELD_RW(GPIO27_EDGE_LOW, 14, 1)
2797 ADD_BITFIELD_RW(GPIO27_LEVEL_HIGH, 13, 1)
2798 ADD_BITFIELD_RW(GPIO27_LEVEL_LOW, 12, 1)
2799 ADD_BITFIELD_RW(GPIO26_EDGE_HIGH, 11, 1)
2800 ADD_BITFIELD_RW(GPIO26_EDGE_LOW, 10, 1)
2801 ADD_BITFIELD_RW(GPIO26_LEVEL_HIGH, 9, 1)
2802 ADD_BITFIELD_RW(GPIO26_LEVEL_LOW, 8, 1)
2803 ADD_BITFIELD_RW(GPIO25_EDGE_HIGH, 7, 1)
2804 ADD_BITFIELD_RW(GPIO25_EDGE_LOW, 6, 1)
2805 ADD_BITFIELD_RW(GPIO25_LEVEL_HIGH, 5, 1)
2806 ADD_BITFIELD_RW(GPIO25_LEVEL_LOW, 4, 1)
2807 ADD_BITFIELD_RW(GPIO24_EDGE_HIGH, 3, 1)
2808 ADD_BITFIELD_RW(GPIO24_EDGE_LOW, 2, 1)
2809 ADD_BITFIELD_RW(GPIO24_LEVEL_HIGH, 1, 1)
2810 ADD_BITFIELD_RW(GPIO24_LEVEL_LOW, 0, 1)
2811 END_TYPE()
2812
2813 // Interrupt Force for dormant_wake
2814 // Reset value: 0x00000000
2815 BEGIN_TYPE(DORMANT_WAKE_INTF0_t, uint32_t)
2816 ADD_BITFIELD_RW(GPIO7_EDGE_HIGH, 31, 1)
2817 ADD_BITFIELD_RW(GPIO7_EDGE_LOW, 30, 1)
2818 ADD_BITFIELD_RW(GPIO7_LEVEL_HIGH, 29, 1)
2819 ADD_BITFIELD_RW(GPIO7_LEVEL_LOW, 28, 1)
2820 ADD_BITFIELD_RW(GPIO6_EDGE_HIGH, 27, 1)
2821 ADD_BITFIELD_RW(GPIO6_EDGE_LOW, 26, 1)
2822 ADD_BITFIELD_RW(GPIO6_LEVEL_HIGH, 25, 1)
2823 ADD_BITFIELD_RW(GPIO6_LEVEL_LOW, 24, 1)
2824 ADD_BITFIELD_RW(GPIO5_EDGE_HIGH, 23, 1)
2825 ADD_BITFIELD_RW(GPIO5_EDGE_LOW, 22, 1)
2826 ADD_BITFIELD_RW(GPIO5_LEVEL_HIGH, 21, 1)
2827 ADD_BITFIELD_RW(GPIO5_LEVEL_LOW, 20, 1)
2828 ADD_BITFIELD_RW(GPIO4_EDGE_HIGH, 19, 1)
2829 ADD_BITFIELD_RW(GPIO4_EDGE_LOW, 18, 1)
2830 ADD_BITFIELD_RW(GPIO4_LEVEL_HIGH, 17, 1)
2831 ADD_BITFIELD_RW(GPIO4_LEVEL_LOW, 16, 1)
2832 ADD_BITFIELD_RW(GPIO3_EDGE_HIGH, 15, 1)
2833 ADD_BITFIELD_RW(GPIO3_EDGE_LOW, 14, 1)
2834 ADD_BITFIELD_RW(GPIO3_LEVEL_HIGH, 13, 1)
2835 ADD_BITFIELD_RW(GPIO3_LEVEL_LOW, 12, 1)
2836 ADD_BITFIELD_RW(GPIO2_EDGE_HIGH, 11, 1)
2837 ADD_BITFIELD_RW(GPIO2_EDGE_LOW, 10, 1)
2838 ADD_BITFIELD_RW(GPIO2_LEVEL_HIGH, 9, 1)
2839 ADD_BITFIELD_RW(GPIO2_LEVEL_LOW, 8, 1)
2840 ADD_BITFIELD_RW(GPIO1_EDGE_HIGH, 7, 1)
2841 ADD_BITFIELD_RW(GPIO1_EDGE_LOW, 6, 1)
2842 ADD_BITFIELD_RW(GPIO1_LEVEL_HIGH, 5, 1)
2843 ADD_BITFIELD_RW(GPIO1_LEVEL_LOW, 4, 1)
2844 ADD_BITFIELD_RW(GPIO0_EDGE_HIGH, 3, 1)
2845 ADD_BITFIELD_RW(GPIO0_EDGE_LOW, 2, 1)
2846 ADD_BITFIELD_RW(GPIO0_LEVEL_HIGH, 1, 1)
2847 ADD_BITFIELD_RW(GPIO0_LEVEL_LOW, 0, 1)
2848 END_TYPE()
2849
2850 // Interrupt Force for dormant_wake
2851 // Reset value: 0x00000000
2852 BEGIN_TYPE(DORMANT_WAKE_INTF1_t, uint32_t)
2853 ADD_BITFIELD_RW(GPIO15_EDGE_HIGH, 31, 1)
2854 ADD_BITFIELD_RW(GPIO15_EDGE_LOW, 30, 1)
2855 ADD_BITFIELD_RW(GPIO15_LEVEL_HIGH, 29, 1)
2856 ADD_BITFIELD_RW(GPIO15_LEVEL_LOW, 28, 1)
2857 ADD_BITFIELD_RW(GPIO14_EDGE_HIGH, 27, 1)
2858 ADD_BITFIELD_RW(GPIO14_EDGE_LOW, 26, 1)
2859 ADD_BITFIELD_RW(GPIO14_LEVEL_HIGH, 25, 1)
2860 ADD_BITFIELD_RW(GPIO14_LEVEL_LOW, 24, 1)
2861 ADD_BITFIELD_RW(GPIO13_EDGE_HIGH, 23, 1)
2862 ADD_BITFIELD_RW(GPIO13_EDGE_LOW, 22, 1)
2863 ADD_BITFIELD_RW(GPIO13_LEVEL_HIGH, 21, 1)
2864 ADD_BITFIELD_RW(GPIO13_LEVEL_LOW, 20, 1)
2865 ADD_BITFIELD_RW(GPIO12_EDGE_HIGH, 19, 1)
2866 ADD_BITFIELD_RW(GPIO12_EDGE_LOW, 18, 1)
2867 ADD_BITFIELD_RW(GPIO12_LEVEL_HIGH, 17, 1)
2868 ADD_BITFIELD_RW(GPIO12_LEVEL_LOW, 16, 1)
2869 ADD_BITFIELD_RW(GPIO11_EDGE_HIGH, 15, 1)
2870 ADD_BITFIELD_RW(GPIO11_EDGE_LOW, 14, 1)
2871 ADD_BITFIELD_RW(GPIO11_LEVEL_HIGH, 13, 1)
2872 ADD_BITFIELD_RW(GPIO11_LEVEL_LOW, 12, 1)
2873 ADD_BITFIELD_RW(GPIO10_EDGE_HIGH, 11, 1)
2874 ADD_BITFIELD_RW(GPIO10_EDGE_LOW, 10, 1)
2875 ADD_BITFIELD_RW(GPIO10_LEVEL_HIGH, 9, 1)
2876 ADD_BITFIELD_RW(GPIO10_LEVEL_LOW, 8, 1)
2877 ADD_BITFIELD_RW(GPIO9_EDGE_HIGH, 7, 1)
2878 ADD_BITFIELD_RW(GPIO9_EDGE_LOW, 6, 1)
2879 ADD_BITFIELD_RW(GPIO9_LEVEL_HIGH, 5, 1)
2880 ADD_BITFIELD_RW(GPIO9_LEVEL_LOW, 4, 1)
2881 ADD_BITFIELD_RW(GPIO8_EDGE_HIGH, 3, 1)
2882 ADD_BITFIELD_RW(GPIO8_EDGE_LOW, 2, 1)
2883 ADD_BITFIELD_RW(GPIO8_LEVEL_HIGH, 1, 1)
2884 ADD_BITFIELD_RW(GPIO8_LEVEL_LOW, 0, 1)
2885 END_TYPE()
2886
2887 // Interrupt Force for dormant_wake
2888 // Reset value: 0x00000000
2889 BEGIN_TYPE(DORMANT_WAKE_INTF2_t, uint32_t)
2890 ADD_BITFIELD_RW(GPIO23_EDGE_HIGH, 31, 1)
2891 ADD_BITFIELD_RW(GPIO23_EDGE_LOW, 30, 1)
2892 ADD_BITFIELD_RW(GPIO23_LEVEL_HIGH, 29, 1)
2893 ADD_BITFIELD_RW(GPIO23_LEVEL_LOW, 28, 1)
2894 ADD_BITFIELD_RW(GPIO22_EDGE_HIGH, 27, 1)
2895 ADD_BITFIELD_RW(GPIO22_EDGE_LOW, 26, 1)
2896 ADD_BITFIELD_RW(GPIO22_LEVEL_HIGH, 25, 1)
2897 ADD_BITFIELD_RW(GPIO22_LEVEL_LOW, 24, 1)
2898 ADD_BITFIELD_RW(GPIO21_EDGE_HIGH, 23, 1)
2899 ADD_BITFIELD_RW(GPIO21_EDGE_LOW, 22, 1)
2900 ADD_BITFIELD_RW(GPIO21_LEVEL_HIGH, 21, 1)
2901 ADD_BITFIELD_RW(GPIO21_LEVEL_LOW, 20, 1)
2902 ADD_BITFIELD_RW(GPIO20_EDGE_HIGH, 19, 1)
2903 ADD_BITFIELD_RW(GPIO20_EDGE_LOW, 18, 1)
2904 ADD_BITFIELD_RW(GPIO20_LEVEL_HIGH, 17, 1)
2905 ADD_BITFIELD_RW(GPIO20_LEVEL_LOW, 16, 1)
2906 ADD_BITFIELD_RW(GPIO19_EDGE_HIGH, 15, 1)
2907 ADD_BITFIELD_RW(GPIO19_EDGE_LOW, 14, 1)
2908 ADD_BITFIELD_RW(GPIO19_LEVEL_HIGH, 13, 1)
2909 ADD_BITFIELD_RW(GPIO19_LEVEL_LOW, 12, 1)
2910 ADD_BITFIELD_RW(GPIO18_EDGE_HIGH, 11, 1)
2911 ADD_BITFIELD_RW(GPIO18_EDGE_LOW, 10, 1)
2912 ADD_BITFIELD_RW(GPIO18_LEVEL_HIGH, 9, 1)
2913 ADD_BITFIELD_RW(GPIO18_LEVEL_LOW, 8, 1)
2914 ADD_BITFIELD_RW(GPIO17_EDGE_HIGH, 7, 1)
2915 ADD_BITFIELD_RW(GPIO17_EDGE_LOW, 6, 1)
2916 ADD_BITFIELD_RW(GPIO17_LEVEL_HIGH, 5, 1)
2917 ADD_BITFIELD_RW(GPIO17_LEVEL_LOW, 4, 1)
2918 ADD_BITFIELD_RW(GPIO16_EDGE_HIGH, 3, 1)
2919 ADD_BITFIELD_RW(GPIO16_EDGE_LOW, 2, 1)
2920 ADD_BITFIELD_RW(GPIO16_LEVEL_HIGH, 1, 1)
2921 ADD_BITFIELD_RW(GPIO16_LEVEL_LOW, 0, 1)
2922 END_TYPE()
2923
2924 // Interrupt Force for dormant_wake
2925 // Reset value: 0x00000000
2926 BEGIN_TYPE(DORMANT_WAKE_INTF3_t, uint32_t)
2927 ADD_BITFIELD_RW(GPIO29_EDGE_HIGH, 23, 1)
2928 ADD_BITFIELD_RW(GPIO29_EDGE_LOW, 22, 1)
2929 ADD_BITFIELD_RW(GPIO29_LEVEL_HIGH, 21, 1)
2930 ADD_BITFIELD_RW(GPIO29_LEVEL_LOW, 20, 1)
2931 ADD_BITFIELD_RW(GPIO28_EDGE_HIGH, 19, 1)
2932 ADD_BITFIELD_RW(GPIO28_EDGE_LOW, 18, 1)
2933 ADD_BITFIELD_RW(GPIO28_LEVEL_HIGH, 17, 1)
2934 ADD_BITFIELD_RW(GPIO28_LEVEL_LOW, 16, 1)
2935 ADD_BITFIELD_RW(GPIO27_EDGE_HIGH, 15, 1)
2936 ADD_BITFIELD_RW(GPIO27_EDGE_LOW, 14, 1)
2937 ADD_BITFIELD_RW(GPIO27_LEVEL_HIGH, 13, 1)
2938 ADD_BITFIELD_RW(GPIO27_LEVEL_LOW, 12, 1)
2939 ADD_BITFIELD_RW(GPIO26_EDGE_HIGH, 11, 1)
2940 ADD_BITFIELD_RW(GPIO26_EDGE_LOW, 10, 1)
2941 ADD_BITFIELD_RW(GPIO26_LEVEL_HIGH, 9, 1)
2942 ADD_BITFIELD_RW(GPIO26_LEVEL_LOW, 8, 1)
2943 ADD_BITFIELD_RW(GPIO25_EDGE_HIGH, 7, 1)
2944 ADD_BITFIELD_RW(GPIO25_EDGE_LOW, 6, 1)
2945 ADD_BITFIELD_RW(GPIO25_LEVEL_HIGH, 5, 1)
2946 ADD_BITFIELD_RW(GPIO25_LEVEL_LOW, 4, 1)
2947 ADD_BITFIELD_RW(GPIO24_EDGE_HIGH, 3, 1)
2948 ADD_BITFIELD_RW(GPIO24_EDGE_LOW, 2, 1)
2949 ADD_BITFIELD_RW(GPIO24_LEVEL_HIGH, 1, 1)
2950 ADD_BITFIELD_RW(GPIO24_LEVEL_LOW, 0, 1)
2951 END_TYPE()
2952
2953 // Interrupt status after masking & forcing for dormant_wake
2954 // Reset value: 0x00000000
2955 BEGIN_TYPE(DORMANT_WAKE_INTS0_t, uint32_t)
2956 ADD_BITFIELD_RO(GPIO7_EDGE_HIGH, 31, 1)
2957 ADD_BITFIELD_RO(GPIO7_EDGE_LOW, 30, 1)
2958 ADD_BITFIELD_RO(GPIO7_LEVEL_HIGH, 29, 1)
2959 ADD_BITFIELD_RO(GPIO7_LEVEL_LOW, 28, 1)
2960 ADD_BITFIELD_RO(GPIO6_EDGE_HIGH, 27, 1)
2961 ADD_BITFIELD_RO(GPIO6_EDGE_LOW, 26, 1)
2962 ADD_BITFIELD_RO(GPIO6_LEVEL_HIGH, 25, 1)
2963 ADD_BITFIELD_RO(GPIO6_LEVEL_LOW, 24, 1)
2964 ADD_BITFIELD_RO(GPIO5_EDGE_HIGH, 23, 1)
2965 ADD_BITFIELD_RO(GPIO5_EDGE_LOW, 22, 1)
2966 ADD_BITFIELD_RO(GPIO5_LEVEL_HIGH, 21, 1)
2967 ADD_BITFIELD_RO(GPIO5_LEVEL_LOW, 20, 1)
2968 ADD_BITFIELD_RO(GPIO4_EDGE_HIGH, 19, 1)
2969 ADD_BITFIELD_RO(GPIO4_EDGE_LOW, 18, 1)
2970 ADD_BITFIELD_RO(GPIO4_LEVEL_HIGH, 17, 1)
2971 ADD_BITFIELD_RO(GPIO4_LEVEL_LOW, 16, 1)
2972 ADD_BITFIELD_RO(GPIO3_EDGE_HIGH, 15, 1)
2973 ADD_BITFIELD_RO(GPIO3_EDGE_LOW, 14, 1)
2974 ADD_BITFIELD_RO(GPIO3_LEVEL_HIGH, 13, 1)
2975 ADD_BITFIELD_RO(GPIO3_LEVEL_LOW, 12, 1)
2976 ADD_BITFIELD_RO(GPIO2_EDGE_HIGH, 11, 1)
2977 ADD_BITFIELD_RO(GPIO2_EDGE_LOW, 10, 1)
2978 ADD_BITFIELD_RO(GPIO2_LEVEL_HIGH, 9, 1)
2979 ADD_BITFIELD_RO(GPIO2_LEVEL_LOW, 8, 1)
2980 ADD_BITFIELD_RO(GPIO1_EDGE_HIGH, 7, 1)
2981 ADD_BITFIELD_RO(GPIO1_EDGE_LOW, 6, 1)
2982 ADD_BITFIELD_RO(GPIO1_LEVEL_HIGH, 5, 1)
2983 ADD_BITFIELD_RO(GPIO1_LEVEL_LOW, 4, 1)
2984 ADD_BITFIELD_RO(GPIO0_EDGE_HIGH, 3, 1)
2985 ADD_BITFIELD_RO(GPIO0_EDGE_LOW, 2, 1)
2986 ADD_BITFIELD_RO(GPIO0_LEVEL_HIGH, 1, 1)
2987 ADD_BITFIELD_RO(GPIO0_LEVEL_LOW, 0, 1)
2988 END_TYPE()
2989
2990 // Interrupt status after masking & forcing for dormant_wake
2991 // Reset value: 0x00000000
2992 BEGIN_TYPE(DORMANT_WAKE_INTS1_t, uint32_t)
2993 ADD_BITFIELD_RO(GPIO15_EDGE_HIGH, 31, 1)
2994 ADD_BITFIELD_RO(GPIO15_EDGE_LOW, 30, 1)
2995 ADD_BITFIELD_RO(GPIO15_LEVEL_HIGH, 29, 1)
2996 ADD_BITFIELD_RO(GPIO15_LEVEL_LOW, 28, 1)
2997 ADD_BITFIELD_RO(GPIO14_EDGE_HIGH, 27, 1)
2998 ADD_BITFIELD_RO(GPIO14_EDGE_LOW, 26, 1)
2999 ADD_BITFIELD_RO(GPIO14_LEVEL_HIGH, 25, 1)
3000 ADD_BITFIELD_RO(GPIO14_LEVEL_LOW, 24, 1)
3001 ADD_BITFIELD_RO(GPIO13_EDGE_HIGH, 23, 1)
3002 ADD_BITFIELD_RO(GPIO13_EDGE_LOW, 22, 1)
3003 ADD_BITFIELD_RO(GPIO13_LEVEL_HIGH, 21, 1)
3004 ADD_BITFIELD_RO(GPIO13_LEVEL_LOW, 20, 1)
3005 ADD_BITFIELD_RO(GPIO12_EDGE_HIGH, 19, 1)
3006 ADD_BITFIELD_RO(GPIO12_EDGE_LOW, 18, 1)
3007 ADD_BITFIELD_RO(GPIO12_LEVEL_HIGH, 17, 1)
3008 ADD_BITFIELD_RO(GPIO12_LEVEL_LOW, 16, 1)
3009 ADD_BITFIELD_RO(GPIO11_EDGE_HIGH, 15, 1)
3010 ADD_BITFIELD_RO(GPIO11_EDGE_LOW, 14, 1)
3011 ADD_BITFIELD_RO(GPIO11_LEVEL_HIGH, 13, 1)
3012 ADD_BITFIELD_RO(GPIO11_LEVEL_LOW, 12, 1)
3013 ADD_BITFIELD_RO(GPIO10_EDGE_HIGH, 11, 1)
3014 ADD_BITFIELD_RO(GPIO10_EDGE_LOW, 10, 1)
3015 ADD_BITFIELD_RO(GPIO10_LEVEL_HIGH, 9, 1)
3016 ADD_BITFIELD_RO(GPIO10_LEVEL_LOW, 8, 1)
3017 ADD_BITFIELD_RO(GPIO9_EDGE_HIGH, 7, 1)
3018 ADD_BITFIELD_RO(GPIO9_EDGE_LOW, 6, 1)
3019 ADD_BITFIELD_RO(GPIO9_LEVEL_HIGH, 5, 1)
3020 ADD_BITFIELD_RO(GPIO9_LEVEL_LOW, 4, 1)
3021 ADD_BITFIELD_RO(GPIO8_EDGE_HIGH, 3, 1)
3022 ADD_BITFIELD_RO(GPIO8_EDGE_LOW, 2, 1)
3023 ADD_BITFIELD_RO(GPIO8_LEVEL_HIGH, 1, 1)
3024 ADD_BITFIELD_RO(GPIO8_LEVEL_LOW, 0, 1)
3025 END_TYPE()
3026
3027 // Interrupt status after masking & forcing for dormant_wake
3028 // Reset value: 0x00000000
3029 BEGIN_TYPE(DORMANT_WAKE_INTS2_t, uint32_t)
3030 ADD_BITFIELD_RO(GPIO23_EDGE_HIGH, 31, 1)
3031 ADD_BITFIELD_RO(GPIO23_EDGE_LOW, 30, 1)
3032 ADD_BITFIELD_RO(GPIO23_LEVEL_HIGH, 29, 1)
3033 ADD_BITFIELD_RO(GPIO23_LEVEL_LOW, 28, 1)
3034 ADD_BITFIELD_RO(GPIO22_EDGE_HIGH, 27, 1)
3035 ADD_BITFIELD_RO(GPIO22_EDGE_LOW, 26, 1)
3036 ADD_BITFIELD_RO(GPIO22_LEVEL_HIGH, 25, 1)
3037 ADD_BITFIELD_RO(GPIO22_LEVEL_LOW, 24, 1)
3038 ADD_BITFIELD_RO(GPIO21_EDGE_HIGH, 23, 1)
3039 ADD_BITFIELD_RO(GPIO21_EDGE_LOW, 22, 1)
3040 ADD_BITFIELD_RO(GPIO21_LEVEL_HIGH, 21, 1)
3041 ADD_BITFIELD_RO(GPIO21_LEVEL_LOW, 20, 1)
3042 ADD_BITFIELD_RO(GPIO20_EDGE_HIGH, 19, 1)
3043 ADD_BITFIELD_RO(GPIO20_EDGE_LOW, 18, 1)
3044 ADD_BITFIELD_RO(GPIO20_LEVEL_HIGH, 17, 1)
3045 ADD_BITFIELD_RO(GPIO20_LEVEL_LOW, 16, 1)
3046 ADD_BITFIELD_RO(GPIO19_EDGE_HIGH, 15, 1)
3047 ADD_BITFIELD_RO(GPIO19_EDGE_LOW, 14, 1)
3048 ADD_BITFIELD_RO(GPIO19_LEVEL_HIGH, 13, 1)
3049 ADD_BITFIELD_RO(GPIO19_LEVEL_LOW, 12, 1)
3050 ADD_BITFIELD_RO(GPIO18_EDGE_HIGH, 11, 1)
3051 ADD_BITFIELD_RO(GPIO18_EDGE_LOW, 10, 1)
3052 ADD_BITFIELD_RO(GPIO18_LEVEL_HIGH, 9, 1)
3053 ADD_BITFIELD_RO(GPIO18_LEVEL_LOW, 8, 1)
3054 ADD_BITFIELD_RO(GPIO17_EDGE_HIGH, 7, 1)
3055 ADD_BITFIELD_RO(GPIO17_EDGE_LOW, 6, 1)
3056 ADD_BITFIELD_RO(GPIO17_LEVEL_HIGH, 5, 1)
3057 ADD_BITFIELD_RO(GPIO17_LEVEL_LOW, 4, 1)
3058 ADD_BITFIELD_RO(GPIO16_EDGE_HIGH, 3, 1)
3059 ADD_BITFIELD_RO(GPIO16_EDGE_LOW, 2, 1)
3060 ADD_BITFIELD_RO(GPIO16_LEVEL_HIGH, 1, 1)
3061 ADD_BITFIELD_RO(GPIO16_LEVEL_LOW, 0, 1)
3062 END_TYPE()
3063
3064 // Interrupt status after masking & forcing for dormant_wake
3065 // Reset value: 0x00000000
3066 BEGIN_TYPE(DORMANT_WAKE_INTS3_t, uint32_t)
3067 ADD_BITFIELD_RO(GPIO29_EDGE_HIGH, 23, 1)
3068 ADD_BITFIELD_RO(GPIO29_EDGE_LOW, 22, 1)
3069 ADD_BITFIELD_RO(GPIO29_LEVEL_HIGH, 21, 1)
3070 ADD_BITFIELD_RO(GPIO29_LEVEL_LOW, 20, 1)
3071 ADD_BITFIELD_RO(GPIO28_EDGE_HIGH, 19, 1)
3072 ADD_BITFIELD_RO(GPIO28_EDGE_LOW, 18, 1)
3073 ADD_BITFIELD_RO(GPIO28_LEVEL_HIGH, 17, 1)
3074 ADD_BITFIELD_RO(GPIO28_LEVEL_LOW, 16, 1)
3075 ADD_BITFIELD_RO(GPIO27_EDGE_HIGH, 15, 1)
3076 ADD_BITFIELD_RO(GPIO27_EDGE_LOW, 14, 1)
3077 ADD_BITFIELD_RO(GPIO27_LEVEL_HIGH, 13, 1)
3078 ADD_BITFIELD_RO(GPIO27_LEVEL_LOW, 12, 1)
3079 ADD_BITFIELD_RO(GPIO26_EDGE_HIGH, 11, 1)
3080 ADD_BITFIELD_RO(GPIO26_EDGE_LOW, 10, 1)
3081 ADD_BITFIELD_RO(GPIO26_LEVEL_HIGH, 9, 1)
3082 ADD_BITFIELD_RO(GPIO26_LEVEL_LOW, 8, 1)
3083 ADD_BITFIELD_RO(GPIO25_EDGE_HIGH, 7, 1)
3084 ADD_BITFIELD_RO(GPIO25_EDGE_LOW, 6, 1)
3085 ADD_BITFIELD_RO(GPIO25_LEVEL_HIGH, 5, 1)
3086 ADD_BITFIELD_RO(GPIO25_LEVEL_LOW, 4, 1)
3087 ADD_BITFIELD_RO(GPIO24_EDGE_HIGH, 3, 1)
3088 ADD_BITFIELD_RO(GPIO24_EDGE_LOW, 2, 1)
3089 ADD_BITFIELD_RO(GPIO24_LEVEL_HIGH, 1, 1)
3090 ADD_BITFIELD_RO(GPIO24_LEVEL_LOW, 0, 1)
3091 END_TYPE()
3092
3093 struct IO_BANK0_t {
3094 GPIO_STATUS_t GPIO0_STATUS;
3095 GPIO_CTRL_t GPIO0_CTRL;
3096 GPIO_STATUS_t GPIO1_STATUS;
3097 GPIO_CTRL_t GPIO1_CTRL;
3098 GPIO_STATUS_t GPIO2_STATUS;
3099 GPIO_CTRL_t GPIO2_CTRL;
3100 GPIO_STATUS_t GPIO3_STATUS;
3101 GPIO_CTRL_t GPIO3_CTRL;
3102 GPIO_STATUS_t GPIO4_STATUS;
3103 GPIO_CTRL_t GPIO4_CTRL;
3104 GPIO_STATUS_t GPIO5_STATUS;
3105 GPIO_CTRL_t GPIO5_CTRL;
3106 GPIO_STATUS_t GPIO6_STATUS;
3107 GPIO_CTRL_t GPIO6_CTRL;
3108 GPIO_STATUS_t GPIO7_STATUS;
3109 GPIO_CTRL_t GPIO7_CTRL;
3110 GPIO_STATUS_t GPIO8_STATUS;
3111 GPIO_CTRL_t GPIO8_CTRL;
3112 GPIO_STATUS_t GPIO9_STATUS;
3113 GPIO_CTRL_t GPIO9_CTRL;
3114 GPIO_STATUS_t GPIO10_STATUS;
3115 GPIO_CTRL_t GPIO10_CTRL;
3116 GPIO_STATUS_t GPIO11_STATUS;
3117 GPIO_CTRL_t GPIO11_CTRL;
3118 GPIO_STATUS_t GPIO12_STATUS;
3119 GPIO_CTRL_t GPIO12_CTRL;
3120 GPIO_STATUS_t GPIO13_STATUS;
3121 GPIO_CTRL_t GPIO13_CTRL;
3122 GPIO_STATUS_t GPIO14_STATUS;
3123 GPIO_CTRL_t GPIO14_CTRL;
3124 GPIO_STATUS_t GPIO15_STATUS;
3125 GPIO_CTRL_t GPIO15_CTRL;
3126 GPIO_STATUS_t GPIO16_STATUS;
3127 GPIO_CTRL_t GPIO16_CTRL;
3128 GPIO_STATUS_t GPIO17_STATUS;
3129 GPIO_CTRL_t GPIO17_CTRL;
3130 GPIO_STATUS_t GPIO18_STATUS;
3131 GPIO_CTRL_t GPIO18_CTRL;
3132 GPIO_STATUS_t GPIO19_STATUS;
3133 GPIO_CTRL_t GPIO19_CTRL;
3134 GPIO_STATUS_t GPIO20_STATUS;
3135 GPIO_CTRL_t GPIO20_CTRL;
3136 GPIO_STATUS_t GPIO21_STATUS;
3137 GPIO_CTRL_t GPIO21_CTRL;
3138 GPIO_STATUS_t GPIO22_STATUS;
3139 GPIO_CTRL_t GPIO22_CTRL;
3140 GPIO_STATUS_t GPIO23_STATUS;
3141 GPIO_CTRL_t GPIO23_CTRL;
3142 GPIO_STATUS_t GPIO24_STATUS;
3143 GPIO_CTRL_t GPIO24_CTRL;
3144 GPIO_STATUS_t GPIO25_STATUS;
3145 GPIO_CTRL_t GPIO25_CTRL;
3146 GPIO_STATUS_t GPIO26_STATUS;
3147 GPIO_CTRL_t GPIO26_CTRL;
3148 GPIO_STATUS_t GPIO27_STATUS;
3149 GPIO_CTRL_t GPIO27_CTRL;
3150 GPIO_STATUS_t GPIO28_STATUS;
3151 GPIO_CTRL_t GPIO28_CTRL;
3152 GPIO_STATUS_t GPIO29_STATUS;
3153 GPIO_CTRL_t GPIO29_CTRL;
3154 INTR0_t INTR0;
3155 INTR1_t INTR1;
3156 INTR2_t INTR2;
3157 INTR3_t INTR3;
3158 PROC0_INTE0_t PROC0_INTE0;
3159 PROC0_INTE1_t PROC0_INTE1;
3160 PROC0_INTE2_t PROC0_INTE2;
3161 PROC0_INTE3_t PROC0_INTE3;
3162 PROC0_INTF0_t PROC0_INTF0;
3163 PROC0_INTF1_t PROC0_INTF1;
3164 PROC0_INTF2_t PROC0_INTF2;
3165 PROC0_INTF3_t PROC0_INTF3;
3166 PROC0_INTS0_t PROC0_INTS0;
3167 PROC0_INTS1_t PROC0_INTS1;
3168 PROC0_INTS2_t PROC0_INTS2;
3169 PROC0_INTS3_t PROC0_INTS3;
3170 PROC1_INTE0_t PROC1_INTE0;
3171 PROC1_INTE1_t PROC1_INTE1;
3172 PROC1_INTE2_t PROC1_INTE2;
3173 PROC1_INTE3_t PROC1_INTE3;
3174 PROC1_INTF0_t PROC1_INTF0;
3175 PROC1_INTF1_t PROC1_INTF1;
3176 PROC1_INTF2_t PROC1_INTF2;
3177 PROC1_INTF3_t PROC1_INTF3;
3178 PROC1_INTS0_t PROC1_INTS0;
3179 PROC1_INTS1_t PROC1_INTS1;
3180 PROC1_INTS2_t PROC1_INTS2;
3181 PROC1_INTS3_t PROC1_INTS3;
3182 DORMANT_WAKE_INTE0_t DORMANT_WAKE_INTE0;
3183 DORMANT_WAKE_INTE1_t DORMANT_WAKE_INTE1;
3184 DORMANT_WAKE_INTE2_t DORMANT_WAKE_INTE2;
3185 DORMANT_WAKE_INTE3_t DORMANT_WAKE_INTE3;
3186 DORMANT_WAKE_INTF0_t DORMANT_WAKE_INTF0;
3187 DORMANT_WAKE_INTF1_t DORMANT_WAKE_INTF1;
3188 DORMANT_WAKE_INTF2_t DORMANT_WAKE_INTF2;
3189 DORMANT_WAKE_INTF3_t DORMANT_WAKE_INTF3;
3190 DORMANT_WAKE_INTS0_t DORMANT_WAKE_INTS0;
3191 DORMANT_WAKE_INTS1_t DORMANT_WAKE_INTS1;
3192 DORMANT_WAKE_INTS2_t DORMANT_WAKE_INTS2;
3193 DORMANT_WAKE_INTS3_t DORMANT_WAKE_INTS3;
3194 };
3195
3196 static IO_BANK0_t & IO_BANK0 = (*(IO_BANK0_t *)0x40014000);
3197 static IO_BANK0_t & IO_BANK0_XOR = (*(IO_BANK0_t *)0x40015000);
3198 static IO_BANK0_t & IO_BANK0_SET = (*(IO_BANK0_t *)0x40016000);
3199 static IO_BANK0_t & IO_BANK0_CLR = (*(IO_BANK0_t *)0x40017000);
3200
3201} // _IO_BANK0_
3202
3203namespace _IO_QSPI_ {
3204
3205 // GPIO status
3206 // Reset value: 0x00000000
3207 BEGIN_TYPE(GPIO_QSPI_SCLK_STATUS_t, uint32_t)
3208 // interrupt to processors, after override is applied
3209 ADD_BITFIELD_RO(IRQTOPROC, 26, 1)
3210 // interrupt from pad before override is applied
3211 ADD_BITFIELD_RO(IRQFROMPAD, 24, 1)
3212 // input signal to peripheral, after override is applied
3213 ADD_BITFIELD_RO(INTOPERI, 19, 1)
3214 // input signal from pad, before override is applied
3215 ADD_BITFIELD_RO(INFROMPAD, 17, 1)
3216 // output enable to pad after register override is applied
3217 ADD_BITFIELD_RO(OETOPAD, 13, 1)
3218 // output enable from selected peripheral, before register override is applied
3219 ADD_BITFIELD_RO(OEFROMPERI, 12, 1)
3220 // output signal to pad after register override is applied
3221 ADD_BITFIELD_RO(OUTTOPAD, 9, 1)
3222 // output signal from selected peripheral, before register override is applied
3223 ADD_BITFIELD_RO(OUTFROMPERI, 8, 1)
3224 END_TYPE()
3225
3226 // GPIO control including function select and overrides.
3227 // Reset value: 0x0000001f
3228 BEGIN_TYPE(GPIO_QSPI_SCLK_CTRL_t, uint32_t)
3229 ADD_BITFIELD_RW(IRQOVER, 28, 2)
3230 ADD_BITFIELD_RW(INOVER, 16, 2)
3231 ADD_BITFIELD_RW(OEOVER, 12, 2)
3232 ADD_BITFIELD_RW(OUTOVER, 8, 2)
3233 // 0-31 -> selects pin function according to the gpio table
3234 // 31 == NULL
3235 ADD_BITFIELD_RW(FUNCSEL, 0, 5)
3236 END_TYPE()
3237
3238 // don't invert the interrupt
3239 static const uint32_t GPIO_QSPI_SCLK_CTRL_IRQOVER__NORMAL = 0;
3240 // invert the interrupt
3241 static const uint32_t GPIO_QSPI_SCLK_CTRL_IRQOVER__INVERT = 1;
3242 // drive interrupt low
3243 static const uint32_t GPIO_QSPI_SCLK_CTRL_IRQOVER__LOW = 2;
3244 // drive interrupt high
3245 static const uint32_t GPIO_QSPI_SCLK_CTRL_IRQOVER__HIGH = 3;
3246 // don't invert the peri input
3247 static const uint32_t GPIO_QSPI_SCLK_CTRL_INOVER__NORMAL = 0;
3248 // invert the peri input
3249 static const uint32_t GPIO_QSPI_SCLK_CTRL_INOVER__INVERT = 1;
3250 // drive peri input low
3251 static const uint32_t GPIO_QSPI_SCLK_CTRL_INOVER__LOW = 2;
3252 // drive peri input high
3253 static const uint32_t GPIO_QSPI_SCLK_CTRL_INOVER__HIGH = 3;
3254 // drive output enable from peripheral signal selected by funcsel
3255 static const uint32_t GPIO_QSPI_SCLK_CTRL_OEOVER__NORMAL = 0;
3256 // drive output enable from inverse of peripheral signal selected by funcsel
3257 static const uint32_t GPIO_QSPI_SCLK_CTRL_OEOVER__INVERT = 1;
3258 // disable output
3259 static const uint32_t GPIO_QSPI_SCLK_CTRL_OEOVER__DISABLE = 2;
3260 // enable output
3261 static const uint32_t GPIO_QSPI_SCLK_CTRL_OEOVER__ENABLE = 3;
3262 // drive output from peripheral signal selected by funcsel
3263 static const uint32_t GPIO_QSPI_SCLK_CTRL_OUTOVER__NORMAL = 0;
3264 // drive output from inverse of peripheral signal selected by funcsel
3265 static const uint32_t GPIO_QSPI_SCLK_CTRL_OUTOVER__INVERT = 1;
3266 // drive output low
3267 static const uint32_t GPIO_QSPI_SCLK_CTRL_OUTOVER__LOW = 2;
3268 // drive output high
3269 static const uint32_t GPIO_QSPI_SCLK_CTRL_OUTOVER__HIGH = 3;
3270 static const uint32_t GPIO_QSPI_SCLK_CTRL_FUNCSEL__xip_sclk = 0;
3271 static const uint32_t GPIO_QSPI_SCLK_CTRL_FUNCSEL__sio_30 = 5;
3272 static const uint32_t GPIO_QSPI_SCLK_CTRL_FUNCSEL__null = 31;
3273
3274 // GPIO status
3275 // Reset value: 0x00000000
3276 BEGIN_TYPE(GPIO_QSPI_SS_STATUS_t, uint32_t)
3277 // interrupt to processors, after override is applied
3278 ADD_BITFIELD_RO(IRQTOPROC, 26, 1)
3279 // interrupt from pad before override is applied
3280 ADD_BITFIELD_RO(IRQFROMPAD, 24, 1)
3281 // input signal to peripheral, after override is applied
3282 ADD_BITFIELD_RO(INTOPERI, 19, 1)
3283 // input signal from pad, before override is applied
3284 ADD_BITFIELD_RO(INFROMPAD, 17, 1)
3285 // output enable to pad after register override is applied
3286 ADD_BITFIELD_RO(OETOPAD, 13, 1)
3287 // output enable from selected peripheral, before register override is applied
3288 ADD_BITFIELD_RO(OEFROMPERI, 12, 1)
3289 // output signal to pad after register override is applied
3290 ADD_BITFIELD_RO(OUTTOPAD, 9, 1)
3291 // output signal from selected peripheral, before register override is applied
3292 ADD_BITFIELD_RO(OUTFROMPERI, 8, 1)
3293 END_TYPE()
3294
3295 // GPIO control including function select and overrides.
3296 // Reset value: 0x0000001f
3297 BEGIN_TYPE(GPIO_QSPI_SS_CTRL_t, uint32_t)
3298 ADD_BITFIELD_RW(IRQOVER, 28, 2)
3299 ADD_BITFIELD_RW(INOVER, 16, 2)
3300 ADD_BITFIELD_RW(OEOVER, 12, 2)
3301 ADD_BITFIELD_RW(OUTOVER, 8, 2)
3302 // 0-31 -> selects pin function according to the gpio table
3303 // 31 == NULL
3304 ADD_BITFIELD_RW(FUNCSEL, 0, 5)
3305 END_TYPE()
3306
3307 // don't invert the interrupt
3308 static const uint32_t GPIO_QSPI_SS_CTRL_IRQOVER__NORMAL = 0;
3309 // invert the interrupt
3310 static const uint32_t GPIO_QSPI_SS_CTRL_IRQOVER__INVERT = 1;
3311 // drive interrupt low
3312 static const uint32_t GPIO_QSPI_SS_CTRL_IRQOVER__LOW = 2;
3313 // drive interrupt high
3314 static const uint32_t GPIO_QSPI_SS_CTRL_IRQOVER__HIGH = 3;
3315 // don't invert the peri input
3316 static const uint32_t GPIO_QSPI_SS_CTRL_INOVER__NORMAL = 0;
3317 // invert the peri input
3318 static const uint32_t GPIO_QSPI_SS_CTRL_INOVER__INVERT = 1;
3319 // drive peri input low
3320 static const uint32_t GPIO_QSPI_SS_CTRL_INOVER__LOW = 2;
3321 // drive peri input high
3322 static const uint32_t GPIO_QSPI_SS_CTRL_INOVER__HIGH = 3;
3323 // drive output enable from peripheral signal selected by funcsel
3324 static const uint32_t GPIO_QSPI_SS_CTRL_OEOVER__NORMAL = 0;
3325 // drive output enable from inverse of peripheral signal selected by funcsel
3326 static const uint32_t GPIO_QSPI_SS_CTRL_OEOVER__INVERT = 1;
3327 // disable output
3328 static const uint32_t GPIO_QSPI_SS_CTRL_OEOVER__DISABLE = 2;
3329 // enable output
3330 static const uint32_t GPIO_QSPI_SS_CTRL_OEOVER__ENABLE = 3;
3331 // drive output from peripheral signal selected by funcsel
3332 static const uint32_t GPIO_QSPI_SS_CTRL_OUTOVER__NORMAL = 0;
3333 // drive output from inverse of peripheral signal selected by funcsel
3334 static const uint32_t GPIO_QSPI_SS_CTRL_OUTOVER__INVERT = 1;
3335 // drive output low
3336 static const uint32_t GPIO_QSPI_SS_CTRL_OUTOVER__LOW = 2;
3337 // drive output high
3338 static const uint32_t GPIO_QSPI_SS_CTRL_OUTOVER__HIGH = 3;
3339 static const uint32_t GPIO_QSPI_SS_CTRL_FUNCSEL__xip_ss_n = 0;
3340 static const uint32_t GPIO_QSPI_SS_CTRL_FUNCSEL__sio_31 = 5;
3341 static const uint32_t GPIO_QSPI_SS_CTRL_FUNCSEL__null = 31;
3342
3343 // GPIO status
3344 // Reset value: 0x00000000
3345 BEGIN_TYPE(GPIO_QSPI_SD0_STATUS_t, uint32_t)
3346 // interrupt to processors, after override is applied
3347 ADD_BITFIELD_RO(IRQTOPROC, 26, 1)
3348 // interrupt from pad before override is applied
3349 ADD_BITFIELD_RO(IRQFROMPAD, 24, 1)
3350 // input signal to peripheral, after override is applied
3351 ADD_BITFIELD_RO(INTOPERI, 19, 1)
3352 // input signal from pad, before override is applied
3353 ADD_BITFIELD_RO(INFROMPAD, 17, 1)
3354 // output enable to pad after register override is applied
3355 ADD_BITFIELD_RO(OETOPAD, 13, 1)
3356 // output enable from selected peripheral, before register override is applied
3357 ADD_BITFIELD_RO(OEFROMPERI, 12, 1)
3358 // output signal to pad after register override is applied
3359 ADD_BITFIELD_RO(OUTTOPAD, 9, 1)
3360 // output signal from selected peripheral, before register override is applied
3361 ADD_BITFIELD_RO(OUTFROMPERI, 8, 1)
3362 END_TYPE()
3363
3364 // GPIO control including function select and overrides.
3365 // Reset value: 0x0000001f
3366 BEGIN_TYPE(GPIO_QSPI_SD0_CTRL_t, uint32_t)
3367 ADD_BITFIELD_RW(IRQOVER, 28, 2)
3368 ADD_BITFIELD_RW(INOVER, 16, 2)
3369 ADD_BITFIELD_RW(OEOVER, 12, 2)
3370 ADD_BITFIELD_RW(OUTOVER, 8, 2)
3371 // 0-31 -> selects pin function according to the gpio table
3372 // 31 == NULL
3373 ADD_BITFIELD_RW(FUNCSEL, 0, 5)
3374 END_TYPE()
3375
3376 // don't invert the interrupt
3377 static const uint32_t GPIO_QSPI_SD0_CTRL_IRQOVER__NORMAL = 0;
3378 // invert the interrupt
3379 static const uint32_t GPIO_QSPI_SD0_CTRL_IRQOVER__INVERT = 1;
3380 // drive interrupt low
3381 static const uint32_t GPIO_QSPI_SD0_CTRL_IRQOVER__LOW = 2;
3382 // drive interrupt high
3383 static const uint32_t GPIO_QSPI_SD0_CTRL_IRQOVER__HIGH = 3;
3384 // don't invert the peri input
3385 static const uint32_t GPIO_QSPI_SD0_CTRL_INOVER__NORMAL = 0;
3386 // invert the peri input
3387 static const uint32_t GPIO_QSPI_SD0_CTRL_INOVER__INVERT = 1;
3388 // drive peri input low
3389 static const uint32_t GPIO_QSPI_SD0_CTRL_INOVER__LOW = 2;
3390 // drive peri input high
3391 static const uint32_t GPIO_QSPI_SD0_CTRL_INOVER__HIGH = 3;
3392 // drive output enable from peripheral signal selected by funcsel
3393 static const uint32_t GPIO_QSPI_SD0_CTRL_OEOVER__NORMAL = 0;
3394 // drive output enable from inverse of peripheral signal selected by funcsel
3395 static const uint32_t GPIO_QSPI_SD0_CTRL_OEOVER__INVERT = 1;
3396 // disable output
3397 static const uint32_t GPIO_QSPI_SD0_CTRL_OEOVER__DISABLE = 2;
3398 // enable output
3399 static const uint32_t GPIO_QSPI_SD0_CTRL_OEOVER__ENABLE = 3;
3400 // drive output from peripheral signal selected by funcsel
3401 static const uint32_t GPIO_QSPI_SD0_CTRL_OUTOVER__NORMAL = 0;
3402 // drive output from inverse of peripheral signal selected by funcsel
3403 static const uint32_t GPIO_QSPI_SD0_CTRL_OUTOVER__INVERT = 1;
3404 // drive output low
3405 static const uint32_t GPIO_QSPI_SD0_CTRL_OUTOVER__LOW = 2;
3406 // drive output high
3407 static const uint32_t GPIO_QSPI_SD0_CTRL_OUTOVER__HIGH = 3;
3408 static const uint32_t GPIO_QSPI_SD0_CTRL_FUNCSEL__xip_sd0 = 0;
3409 static const uint32_t GPIO_QSPI_SD0_CTRL_FUNCSEL__sio_32 = 5;
3410 static const uint32_t GPIO_QSPI_SD0_CTRL_FUNCSEL__null = 31;
3411
3412 // GPIO status
3413 // Reset value: 0x00000000
3414 BEGIN_TYPE(GPIO_QSPI_SD1_STATUS_t, uint32_t)
3415 // interrupt to processors, after override is applied
3416 ADD_BITFIELD_RO(IRQTOPROC, 26, 1)
3417 // interrupt from pad before override is applied
3418 ADD_BITFIELD_RO(IRQFROMPAD, 24, 1)
3419 // input signal to peripheral, after override is applied
3420 ADD_BITFIELD_RO(INTOPERI, 19, 1)
3421 // input signal from pad, before override is applied
3422 ADD_BITFIELD_RO(INFROMPAD, 17, 1)
3423 // output enable to pad after register override is applied
3424 ADD_BITFIELD_RO(OETOPAD, 13, 1)
3425 // output enable from selected peripheral, before register override is applied
3426 ADD_BITFIELD_RO(OEFROMPERI, 12, 1)
3427 // output signal to pad after register override is applied
3428 ADD_BITFIELD_RO(OUTTOPAD, 9, 1)
3429 // output signal from selected peripheral, before register override is applied
3430 ADD_BITFIELD_RO(OUTFROMPERI, 8, 1)
3431 END_TYPE()
3432
3433 // GPIO control including function select and overrides.
3434 // Reset value: 0x0000001f
3435 BEGIN_TYPE(GPIO_QSPI_SD1_CTRL_t, uint32_t)
3436 ADD_BITFIELD_RW(IRQOVER, 28, 2)
3437 ADD_BITFIELD_RW(INOVER, 16, 2)
3438 ADD_BITFIELD_RW(OEOVER, 12, 2)
3439 ADD_BITFIELD_RW(OUTOVER, 8, 2)
3440 // 0-31 -> selects pin function according to the gpio table
3441 // 31 == NULL
3442 ADD_BITFIELD_RW(FUNCSEL, 0, 5)
3443 END_TYPE()
3444
3445 // don't invert the interrupt
3446 static const uint32_t GPIO_QSPI_SD1_CTRL_IRQOVER__NORMAL = 0;
3447 // invert the interrupt
3448 static const uint32_t GPIO_QSPI_SD1_CTRL_IRQOVER__INVERT = 1;
3449 // drive interrupt low
3450 static const uint32_t GPIO_QSPI_SD1_CTRL_IRQOVER__LOW = 2;
3451 // drive interrupt high
3452 static const uint32_t GPIO_QSPI_SD1_CTRL_IRQOVER__HIGH = 3;
3453 // don't invert the peri input
3454 static const uint32_t GPIO_QSPI_SD1_CTRL_INOVER__NORMAL = 0;
3455 // invert the peri input
3456 static const uint32_t GPIO_QSPI_SD1_CTRL_INOVER__INVERT = 1;
3457 // drive peri input low
3458 static const uint32_t GPIO_QSPI_SD1_CTRL_INOVER__LOW = 2;
3459 // drive peri input high
3460 static const uint32_t GPIO_QSPI_SD1_CTRL_INOVER__HIGH = 3;
3461 // drive output enable from peripheral signal selected by funcsel
3462 static const uint32_t GPIO_QSPI_SD1_CTRL_OEOVER__NORMAL = 0;
3463 // drive output enable from inverse of peripheral signal selected by funcsel
3464 static const uint32_t GPIO_QSPI_SD1_CTRL_OEOVER__INVERT = 1;
3465 // disable output
3466 static const uint32_t GPIO_QSPI_SD1_CTRL_OEOVER__DISABLE = 2;
3467 // enable output
3468 static const uint32_t GPIO_QSPI_SD1_CTRL_OEOVER__ENABLE = 3;
3469 // drive output from peripheral signal selected by funcsel
3470 static const uint32_t GPIO_QSPI_SD1_CTRL_OUTOVER__NORMAL = 0;
3471 // drive output from inverse of peripheral signal selected by funcsel
3472 static const uint32_t GPIO_QSPI_SD1_CTRL_OUTOVER__INVERT = 1;
3473 // drive output low
3474 static const uint32_t GPIO_QSPI_SD1_CTRL_OUTOVER__LOW = 2;
3475 // drive output high
3476 static const uint32_t GPIO_QSPI_SD1_CTRL_OUTOVER__HIGH = 3;
3477 static const uint32_t GPIO_QSPI_SD1_CTRL_FUNCSEL__xip_sd1 = 0;
3478 static const uint32_t GPIO_QSPI_SD1_CTRL_FUNCSEL__sio_33 = 5;
3479 static const uint32_t GPIO_QSPI_SD1_CTRL_FUNCSEL__null = 31;
3480
3481 // GPIO status
3482 // Reset value: 0x00000000
3483 BEGIN_TYPE(GPIO_QSPI_SD2_STATUS_t, uint32_t)
3484 // interrupt to processors, after override is applied
3485 ADD_BITFIELD_RO(IRQTOPROC, 26, 1)
3486 // interrupt from pad before override is applied
3487 ADD_BITFIELD_RO(IRQFROMPAD, 24, 1)
3488 // input signal to peripheral, after override is applied
3489 ADD_BITFIELD_RO(INTOPERI, 19, 1)
3490 // input signal from pad, before override is applied
3491 ADD_BITFIELD_RO(INFROMPAD, 17, 1)
3492 // output enable to pad after register override is applied
3493 ADD_BITFIELD_RO(OETOPAD, 13, 1)
3494 // output enable from selected peripheral, before register override is applied
3495 ADD_BITFIELD_RO(OEFROMPERI, 12, 1)
3496 // output signal to pad after register override is applied
3497 ADD_BITFIELD_RO(OUTTOPAD, 9, 1)
3498 // output signal from selected peripheral, before register override is applied
3499 ADD_BITFIELD_RO(OUTFROMPERI, 8, 1)
3500 END_TYPE()
3501
3502 // GPIO control including function select and overrides.
3503 // Reset value: 0x0000001f
3504 BEGIN_TYPE(GPIO_QSPI_SD2_CTRL_t, uint32_t)
3505 ADD_BITFIELD_RW(IRQOVER, 28, 2)
3506 ADD_BITFIELD_RW(INOVER, 16, 2)
3507 ADD_BITFIELD_RW(OEOVER, 12, 2)
3508 ADD_BITFIELD_RW(OUTOVER, 8, 2)
3509 // 0-31 -> selects pin function according to the gpio table
3510 // 31 == NULL
3511 ADD_BITFIELD_RW(FUNCSEL, 0, 5)
3512 END_TYPE()
3513
3514 // don't invert the interrupt
3515 static const uint32_t GPIO_QSPI_SD2_CTRL_IRQOVER__NORMAL = 0;
3516 // invert the interrupt
3517 static const uint32_t GPIO_QSPI_SD2_CTRL_IRQOVER__INVERT = 1;
3518 // drive interrupt low
3519 static const uint32_t GPIO_QSPI_SD2_CTRL_IRQOVER__LOW = 2;
3520 // drive interrupt high
3521 static const uint32_t GPIO_QSPI_SD2_CTRL_IRQOVER__HIGH = 3;
3522 // don't invert the peri input
3523 static const uint32_t GPIO_QSPI_SD2_CTRL_INOVER__NORMAL = 0;
3524 // invert the peri input
3525 static const uint32_t GPIO_QSPI_SD2_CTRL_INOVER__INVERT = 1;
3526 // drive peri input low
3527 static const uint32_t GPIO_QSPI_SD2_CTRL_INOVER__LOW = 2;
3528 // drive peri input high
3529 static const uint32_t GPIO_QSPI_SD2_CTRL_INOVER__HIGH = 3;
3530 // drive output enable from peripheral signal selected by funcsel
3531 static const uint32_t GPIO_QSPI_SD2_CTRL_OEOVER__NORMAL = 0;
3532 // drive output enable from inverse of peripheral signal selected by funcsel
3533 static const uint32_t GPIO_QSPI_SD2_CTRL_OEOVER__INVERT = 1;
3534 // disable output
3535 static const uint32_t GPIO_QSPI_SD2_CTRL_OEOVER__DISABLE = 2;
3536 // enable output
3537 static const uint32_t GPIO_QSPI_SD2_CTRL_OEOVER__ENABLE = 3;
3538 // drive output from peripheral signal selected by funcsel
3539 static const uint32_t GPIO_QSPI_SD2_CTRL_OUTOVER__NORMAL = 0;
3540 // drive output from inverse of peripheral signal selected by funcsel
3541 static const uint32_t GPIO_QSPI_SD2_CTRL_OUTOVER__INVERT = 1;
3542 // drive output low
3543 static const uint32_t GPIO_QSPI_SD2_CTRL_OUTOVER__LOW = 2;
3544 // drive output high
3545 static const uint32_t GPIO_QSPI_SD2_CTRL_OUTOVER__HIGH = 3;
3546 static const uint32_t GPIO_QSPI_SD2_CTRL_FUNCSEL__xip_sd2 = 0;
3547 static const uint32_t GPIO_QSPI_SD2_CTRL_FUNCSEL__sio_34 = 5;
3548 static const uint32_t GPIO_QSPI_SD2_CTRL_FUNCSEL__null = 31;
3549
3550 // GPIO status
3551 // Reset value: 0x00000000
3552 BEGIN_TYPE(GPIO_QSPI_SD3_STATUS_t, uint32_t)
3553 // interrupt to processors, after override is applied
3554 ADD_BITFIELD_RO(IRQTOPROC, 26, 1)
3555 // interrupt from pad before override is applied
3556 ADD_BITFIELD_RO(IRQFROMPAD, 24, 1)
3557 // input signal to peripheral, after override is applied
3558 ADD_BITFIELD_RO(INTOPERI, 19, 1)
3559 // input signal from pad, before override is applied
3560 ADD_BITFIELD_RO(INFROMPAD, 17, 1)
3561 // output enable to pad after register override is applied
3562 ADD_BITFIELD_RO(OETOPAD, 13, 1)
3563 // output enable from selected peripheral, before register override is applied
3564 ADD_BITFIELD_RO(OEFROMPERI, 12, 1)
3565 // output signal to pad after register override is applied
3566 ADD_BITFIELD_RO(OUTTOPAD, 9, 1)
3567 // output signal from selected peripheral, before register override is applied
3568 ADD_BITFIELD_RO(OUTFROMPERI, 8, 1)
3569 END_TYPE()
3570
3571 // GPIO control including function select and overrides.
3572 // Reset value: 0x0000001f
3573 BEGIN_TYPE(GPIO_QSPI_SD3_CTRL_t, uint32_t)
3574 ADD_BITFIELD_RW(IRQOVER, 28, 2)
3575 ADD_BITFIELD_RW(INOVER, 16, 2)
3576 ADD_BITFIELD_RW(OEOVER, 12, 2)
3577 ADD_BITFIELD_RW(OUTOVER, 8, 2)
3578 // 0-31 -> selects pin function according to the gpio table
3579 // 31 == NULL
3580 ADD_BITFIELD_RW(FUNCSEL, 0, 5)
3581 END_TYPE()
3582
3583 // don't invert the interrupt
3584 static const uint32_t GPIO_QSPI_SD3_CTRL_IRQOVER__NORMAL = 0;
3585 // invert the interrupt
3586 static const uint32_t GPIO_QSPI_SD3_CTRL_IRQOVER__INVERT = 1;
3587 // drive interrupt low
3588 static const uint32_t GPIO_QSPI_SD3_CTRL_IRQOVER__LOW = 2;
3589 // drive interrupt high
3590 static const uint32_t GPIO_QSPI_SD3_CTRL_IRQOVER__HIGH = 3;
3591 // don't invert the peri input
3592 static const uint32_t GPIO_QSPI_SD3_CTRL_INOVER__NORMAL = 0;
3593 // invert the peri input
3594 static const uint32_t GPIO_QSPI_SD3_CTRL_INOVER__INVERT = 1;
3595 // drive peri input low
3596 static const uint32_t GPIO_QSPI_SD3_CTRL_INOVER__LOW = 2;
3597 // drive peri input high
3598 static const uint32_t GPIO_QSPI_SD3_CTRL_INOVER__HIGH = 3;
3599 // drive output enable from peripheral signal selected by funcsel
3600 static const uint32_t GPIO_QSPI_SD3_CTRL_OEOVER__NORMAL = 0;
3601 // drive output enable from inverse of peripheral signal selected by funcsel
3602 static const uint32_t GPIO_QSPI_SD3_CTRL_OEOVER__INVERT = 1;
3603 // disable output
3604 static const uint32_t GPIO_QSPI_SD3_CTRL_OEOVER__DISABLE = 2;
3605 // enable output
3606 static const uint32_t GPIO_QSPI_SD3_CTRL_OEOVER__ENABLE = 3;
3607 // drive output from peripheral signal selected by funcsel
3608 static const uint32_t GPIO_QSPI_SD3_CTRL_OUTOVER__NORMAL = 0;
3609 // drive output from inverse of peripheral signal selected by funcsel
3610 static const uint32_t GPIO_QSPI_SD3_CTRL_OUTOVER__INVERT = 1;
3611 // drive output low
3612 static const uint32_t GPIO_QSPI_SD3_CTRL_OUTOVER__LOW = 2;
3613 // drive output high
3614 static const uint32_t GPIO_QSPI_SD3_CTRL_OUTOVER__HIGH = 3;
3615 static const uint32_t GPIO_QSPI_SD3_CTRL_FUNCSEL__xip_sd3 = 0;
3616 static const uint32_t GPIO_QSPI_SD3_CTRL_FUNCSEL__sio_35 = 5;
3617 static const uint32_t GPIO_QSPI_SD3_CTRL_FUNCSEL__null = 31;
3618
3619 // Raw Interrupts
3620 // Reset value: 0x00000000
3621 BEGIN_TYPE(INTR_t, uint32_t)
3622 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_HIGH, 23, 1)
3623 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_LOW, 22, 1)
3624 ADD_BITFIELD_RO(GPIO_QSPI_SD3_LEVEL_HIGH, 21, 1)
3625 ADD_BITFIELD_RO(GPIO_QSPI_SD3_LEVEL_LOW, 20, 1)
3626 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_HIGH, 19, 1)
3627 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_LOW, 18, 1)
3628 ADD_BITFIELD_RO(GPIO_QSPI_SD2_LEVEL_HIGH, 17, 1)
3629 ADD_BITFIELD_RO(GPIO_QSPI_SD2_LEVEL_LOW, 16, 1)
3630 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_HIGH, 15, 1)
3631 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_LOW, 14, 1)
3632 ADD_BITFIELD_RO(GPIO_QSPI_SD1_LEVEL_HIGH, 13, 1)
3633 ADD_BITFIELD_RO(GPIO_QSPI_SD1_LEVEL_LOW, 12, 1)
3634 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_HIGH, 11, 1)
3635 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_LOW, 10, 1)
3636 ADD_BITFIELD_RO(GPIO_QSPI_SD0_LEVEL_HIGH, 9, 1)
3637 ADD_BITFIELD_RO(GPIO_QSPI_SD0_LEVEL_LOW, 8, 1)
3638 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_HIGH, 7, 1)
3639 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_LOW, 6, 1)
3640 ADD_BITFIELD_RO(GPIO_QSPI_SS_LEVEL_HIGH, 5, 1)
3641 ADD_BITFIELD_RO(GPIO_QSPI_SS_LEVEL_LOW, 4, 1)
3642 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_HIGH, 3, 1)
3643 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_LOW, 2, 1)
3644 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_LEVEL_HIGH, 1, 1)
3645 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_LEVEL_LOW, 0, 1)
3646 END_TYPE()
3647
3648 // Interrupt Enable for proc0
3649 // Reset value: 0x00000000
3650 BEGIN_TYPE(PROC0_INTE_t, uint32_t)
3651 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_HIGH, 23, 1)
3652 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_LOW, 22, 1)
3653 ADD_BITFIELD_RW(GPIO_QSPI_SD3_LEVEL_HIGH, 21, 1)
3654 ADD_BITFIELD_RW(GPIO_QSPI_SD3_LEVEL_LOW, 20, 1)
3655 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_HIGH, 19, 1)
3656 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_LOW, 18, 1)
3657 ADD_BITFIELD_RW(GPIO_QSPI_SD2_LEVEL_HIGH, 17, 1)
3658 ADD_BITFIELD_RW(GPIO_QSPI_SD2_LEVEL_LOW, 16, 1)
3659 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_HIGH, 15, 1)
3660 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_LOW, 14, 1)
3661 ADD_BITFIELD_RW(GPIO_QSPI_SD1_LEVEL_HIGH, 13, 1)
3662 ADD_BITFIELD_RW(GPIO_QSPI_SD1_LEVEL_LOW, 12, 1)
3663 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_HIGH, 11, 1)
3664 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_LOW, 10, 1)
3665 ADD_BITFIELD_RW(GPIO_QSPI_SD0_LEVEL_HIGH, 9, 1)
3666 ADD_BITFIELD_RW(GPIO_QSPI_SD0_LEVEL_LOW, 8, 1)
3667 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_HIGH, 7, 1)
3668 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_LOW, 6, 1)
3669 ADD_BITFIELD_RW(GPIO_QSPI_SS_LEVEL_HIGH, 5, 1)
3670 ADD_BITFIELD_RW(GPIO_QSPI_SS_LEVEL_LOW, 4, 1)
3671 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_HIGH, 3, 1)
3672 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_LOW, 2, 1)
3673 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_LEVEL_HIGH, 1, 1)
3674 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_LEVEL_LOW, 0, 1)
3675 END_TYPE()
3676
3677 // Interrupt Force for proc0
3678 // Reset value: 0x00000000
3679 BEGIN_TYPE(PROC0_INTF_t, uint32_t)
3680 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_HIGH, 23, 1)
3681 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_LOW, 22, 1)
3682 ADD_BITFIELD_RW(GPIO_QSPI_SD3_LEVEL_HIGH, 21, 1)
3683 ADD_BITFIELD_RW(GPIO_QSPI_SD3_LEVEL_LOW, 20, 1)
3684 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_HIGH, 19, 1)
3685 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_LOW, 18, 1)
3686 ADD_BITFIELD_RW(GPIO_QSPI_SD2_LEVEL_HIGH, 17, 1)
3687 ADD_BITFIELD_RW(GPIO_QSPI_SD2_LEVEL_LOW, 16, 1)
3688 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_HIGH, 15, 1)
3689 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_LOW, 14, 1)
3690 ADD_BITFIELD_RW(GPIO_QSPI_SD1_LEVEL_HIGH, 13, 1)
3691 ADD_BITFIELD_RW(GPIO_QSPI_SD1_LEVEL_LOW, 12, 1)
3692 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_HIGH, 11, 1)
3693 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_LOW, 10, 1)
3694 ADD_BITFIELD_RW(GPIO_QSPI_SD0_LEVEL_HIGH, 9, 1)
3695 ADD_BITFIELD_RW(GPIO_QSPI_SD0_LEVEL_LOW, 8, 1)
3696 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_HIGH, 7, 1)
3697 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_LOW, 6, 1)
3698 ADD_BITFIELD_RW(GPIO_QSPI_SS_LEVEL_HIGH, 5, 1)
3699 ADD_BITFIELD_RW(GPIO_QSPI_SS_LEVEL_LOW, 4, 1)
3700 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_HIGH, 3, 1)
3701 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_LOW, 2, 1)
3702 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_LEVEL_HIGH, 1, 1)
3703 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_LEVEL_LOW, 0, 1)
3704 END_TYPE()
3705
3706 // Interrupt status after masking & forcing for proc0
3707 // Reset value: 0x00000000
3708 BEGIN_TYPE(PROC0_INTS_t, uint32_t)
3709 ADD_BITFIELD_RO(GPIO_QSPI_SD3_EDGE_HIGH, 23, 1)
3710 ADD_BITFIELD_RO(GPIO_QSPI_SD3_EDGE_LOW, 22, 1)
3711 ADD_BITFIELD_RO(GPIO_QSPI_SD3_LEVEL_HIGH, 21, 1)
3712 ADD_BITFIELD_RO(GPIO_QSPI_SD3_LEVEL_LOW, 20, 1)
3713 ADD_BITFIELD_RO(GPIO_QSPI_SD2_EDGE_HIGH, 19, 1)
3714 ADD_BITFIELD_RO(GPIO_QSPI_SD2_EDGE_LOW, 18, 1)
3715 ADD_BITFIELD_RO(GPIO_QSPI_SD2_LEVEL_HIGH, 17, 1)
3716 ADD_BITFIELD_RO(GPIO_QSPI_SD2_LEVEL_LOW, 16, 1)
3717 ADD_BITFIELD_RO(GPIO_QSPI_SD1_EDGE_HIGH, 15, 1)
3718 ADD_BITFIELD_RO(GPIO_QSPI_SD1_EDGE_LOW, 14, 1)
3719 ADD_BITFIELD_RO(GPIO_QSPI_SD1_LEVEL_HIGH, 13, 1)
3720 ADD_BITFIELD_RO(GPIO_QSPI_SD1_LEVEL_LOW, 12, 1)
3721 ADD_BITFIELD_RO(GPIO_QSPI_SD0_EDGE_HIGH, 11, 1)
3722 ADD_BITFIELD_RO(GPIO_QSPI_SD0_EDGE_LOW, 10, 1)
3723 ADD_BITFIELD_RO(GPIO_QSPI_SD0_LEVEL_HIGH, 9, 1)
3724 ADD_BITFIELD_RO(GPIO_QSPI_SD0_LEVEL_LOW, 8, 1)
3725 ADD_BITFIELD_RO(GPIO_QSPI_SS_EDGE_HIGH, 7, 1)
3726 ADD_BITFIELD_RO(GPIO_QSPI_SS_EDGE_LOW, 6, 1)
3727 ADD_BITFIELD_RO(GPIO_QSPI_SS_LEVEL_HIGH, 5, 1)
3728 ADD_BITFIELD_RO(GPIO_QSPI_SS_LEVEL_LOW, 4, 1)
3729 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_EDGE_HIGH, 3, 1)
3730 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_EDGE_LOW, 2, 1)
3731 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_LEVEL_HIGH, 1, 1)
3732 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_LEVEL_LOW, 0, 1)
3733 END_TYPE()
3734
3735 // Interrupt Enable for proc1
3736 // Reset value: 0x00000000
3737 BEGIN_TYPE(PROC1_INTE_t, uint32_t)
3738 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_HIGH, 23, 1)
3739 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_LOW, 22, 1)
3740 ADD_BITFIELD_RW(GPIO_QSPI_SD3_LEVEL_HIGH, 21, 1)
3741 ADD_BITFIELD_RW(GPIO_QSPI_SD3_LEVEL_LOW, 20, 1)
3742 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_HIGH, 19, 1)
3743 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_LOW, 18, 1)
3744 ADD_BITFIELD_RW(GPIO_QSPI_SD2_LEVEL_HIGH, 17, 1)
3745 ADD_BITFIELD_RW(GPIO_QSPI_SD2_LEVEL_LOW, 16, 1)
3746 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_HIGH, 15, 1)
3747 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_LOW, 14, 1)
3748 ADD_BITFIELD_RW(GPIO_QSPI_SD1_LEVEL_HIGH, 13, 1)
3749 ADD_BITFIELD_RW(GPIO_QSPI_SD1_LEVEL_LOW, 12, 1)
3750 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_HIGH, 11, 1)
3751 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_LOW, 10, 1)
3752 ADD_BITFIELD_RW(GPIO_QSPI_SD0_LEVEL_HIGH, 9, 1)
3753 ADD_BITFIELD_RW(GPIO_QSPI_SD0_LEVEL_LOW, 8, 1)
3754 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_HIGH, 7, 1)
3755 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_LOW, 6, 1)
3756 ADD_BITFIELD_RW(GPIO_QSPI_SS_LEVEL_HIGH, 5, 1)
3757 ADD_BITFIELD_RW(GPIO_QSPI_SS_LEVEL_LOW, 4, 1)
3758 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_HIGH, 3, 1)
3759 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_LOW, 2, 1)
3760 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_LEVEL_HIGH, 1, 1)
3761 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_LEVEL_LOW, 0, 1)
3762 END_TYPE()
3763
3764 // Interrupt Force for proc1
3765 // Reset value: 0x00000000
3766 BEGIN_TYPE(PROC1_INTF_t, uint32_t)
3767 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_HIGH, 23, 1)
3768 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_LOW, 22, 1)
3769 ADD_BITFIELD_RW(GPIO_QSPI_SD3_LEVEL_HIGH, 21, 1)
3770 ADD_BITFIELD_RW(GPIO_QSPI_SD3_LEVEL_LOW, 20, 1)
3771 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_HIGH, 19, 1)
3772 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_LOW, 18, 1)
3773 ADD_BITFIELD_RW(GPIO_QSPI_SD2_LEVEL_HIGH, 17, 1)
3774 ADD_BITFIELD_RW(GPIO_QSPI_SD2_LEVEL_LOW, 16, 1)
3775 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_HIGH, 15, 1)
3776 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_LOW, 14, 1)
3777 ADD_BITFIELD_RW(GPIO_QSPI_SD1_LEVEL_HIGH, 13, 1)
3778 ADD_BITFIELD_RW(GPIO_QSPI_SD1_LEVEL_LOW, 12, 1)
3779 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_HIGH, 11, 1)
3780 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_LOW, 10, 1)
3781 ADD_BITFIELD_RW(GPIO_QSPI_SD0_LEVEL_HIGH, 9, 1)
3782 ADD_BITFIELD_RW(GPIO_QSPI_SD0_LEVEL_LOW, 8, 1)
3783 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_HIGH, 7, 1)
3784 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_LOW, 6, 1)
3785 ADD_BITFIELD_RW(GPIO_QSPI_SS_LEVEL_HIGH, 5, 1)
3786 ADD_BITFIELD_RW(GPIO_QSPI_SS_LEVEL_LOW, 4, 1)
3787 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_HIGH, 3, 1)
3788 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_LOW, 2, 1)
3789 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_LEVEL_HIGH, 1, 1)
3790 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_LEVEL_LOW, 0, 1)
3791 END_TYPE()
3792
3793 // Interrupt status after masking & forcing for proc1
3794 // Reset value: 0x00000000
3795 BEGIN_TYPE(PROC1_INTS_t, uint32_t)
3796 ADD_BITFIELD_RO(GPIO_QSPI_SD3_EDGE_HIGH, 23, 1)
3797 ADD_BITFIELD_RO(GPIO_QSPI_SD3_EDGE_LOW, 22, 1)
3798 ADD_BITFIELD_RO(GPIO_QSPI_SD3_LEVEL_HIGH, 21, 1)
3799 ADD_BITFIELD_RO(GPIO_QSPI_SD3_LEVEL_LOW, 20, 1)
3800 ADD_BITFIELD_RO(GPIO_QSPI_SD2_EDGE_HIGH, 19, 1)
3801 ADD_BITFIELD_RO(GPIO_QSPI_SD2_EDGE_LOW, 18, 1)
3802 ADD_BITFIELD_RO(GPIO_QSPI_SD2_LEVEL_HIGH, 17, 1)
3803 ADD_BITFIELD_RO(GPIO_QSPI_SD2_LEVEL_LOW, 16, 1)
3804 ADD_BITFIELD_RO(GPIO_QSPI_SD1_EDGE_HIGH, 15, 1)
3805 ADD_BITFIELD_RO(GPIO_QSPI_SD1_EDGE_LOW, 14, 1)
3806 ADD_BITFIELD_RO(GPIO_QSPI_SD1_LEVEL_HIGH, 13, 1)
3807 ADD_BITFIELD_RO(GPIO_QSPI_SD1_LEVEL_LOW, 12, 1)
3808 ADD_BITFIELD_RO(GPIO_QSPI_SD0_EDGE_HIGH, 11, 1)
3809 ADD_BITFIELD_RO(GPIO_QSPI_SD0_EDGE_LOW, 10, 1)
3810 ADD_BITFIELD_RO(GPIO_QSPI_SD0_LEVEL_HIGH, 9, 1)
3811 ADD_BITFIELD_RO(GPIO_QSPI_SD0_LEVEL_LOW, 8, 1)
3812 ADD_BITFIELD_RO(GPIO_QSPI_SS_EDGE_HIGH, 7, 1)
3813 ADD_BITFIELD_RO(GPIO_QSPI_SS_EDGE_LOW, 6, 1)
3814 ADD_BITFIELD_RO(GPIO_QSPI_SS_LEVEL_HIGH, 5, 1)
3815 ADD_BITFIELD_RO(GPIO_QSPI_SS_LEVEL_LOW, 4, 1)
3816 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_EDGE_HIGH, 3, 1)
3817 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_EDGE_LOW, 2, 1)
3818 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_LEVEL_HIGH, 1, 1)
3819 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_LEVEL_LOW, 0, 1)
3820 END_TYPE()
3821
3822 // Interrupt Enable for dormant_wake
3823 // Reset value: 0x00000000
3824 BEGIN_TYPE(DORMANT_WAKE_INTE_t, uint32_t)
3825 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_HIGH, 23, 1)
3826 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_LOW, 22, 1)
3827 ADD_BITFIELD_RW(GPIO_QSPI_SD3_LEVEL_HIGH, 21, 1)
3828 ADD_BITFIELD_RW(GPIO_QSPI_SD3_LEVEL_LOW, 20, 1)
3829 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_HIGH, 19, 1)
3830 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_LOW, 18, 1)
3831 ADD_BITFIELD_RW(GPIO_QSPI_SD2_LEVEL_HIGH, 17, 1)
3832 ADD_BITFIELD_RW(GPIO_QSPI_SD2_LEVEL_LOW, 16, 1)
3833 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_HIGH, 15, 1)
3834 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_LOW, 14, 1)
3835 ADD_BITFIELD_RW(GPIO_QSPI_SD1_LEVEL_HIGH, 13, 1)
3836 ADD_BITFIELD_RW(GPIO_QSPI_SD1_LEVEL_LOW, 12, 1)
3837 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_HIGH, 11, 1)
3838 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_LOW, 10, 1)
3839 ADD_BITFIELD_RW(GPIO_QSPI_SD0_LEVEL_HIGH, 9, 1)
3840 ADD_BITFIELD_RW(GPIO_QSPI_SD0_LEVEL_LOW, 8, 1)
3841 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_HIGH, 7, 1)
3842 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_LOW, 6, 1)
3843 ADD_BITFIELD_RW(GPIO_QSPI_SS_LEVEL_HIGH, 5, 1)
3844 ADD_BITFIELD_RW(GPIO_QSPI_SS_LEVEL_LOW, 4, 1)
3845 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_HIGH, 3, 1)
3846 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_LOW, 2, 1)
3847 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_LEVEL_HIGH, 1, 1)
3848 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_LEVEL_LOW, 0, 1)
3849 END_TYPE()
3850
3851 // Interrupt Force for dormant_wake
3852 // Reset value: 0x00000000
3853 BEGIN_TYPE(DORMANT_WAKE_INTF_t, uint32_t)
3854 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_HIGH, 23, 1)
3855 ADD_BITFIELD_RW(GPIO_QSPI_SD3_EDGE_LOW, 22, 1)
3856 ADD_BITFIELD_RW(GPIO_QSPI_SD3_LEVEL_HIGH, 21, 1)
3857 ADD_BITFIELD_RW(GPIO_QSPI_SD3_LEVEL_LOW, 20, 1)
3858 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_HIGH, 19, 1)
3859 ADD_BITFIELD_RW(GPIO_QSPI_SD2_EDGE_LOW, 18, 1)
3860 ADD_BITFIELD_RW(GPIO_QSPI_SD2_LEVEL_HIGH, 17, 1)
3861 ADD_BITFIELD_RW(GPIO_QSPI_SD2_LEVEL_LOW, 16, 1)
3862 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_HIGH, 15, 1)
3863 ADD_BITFIELD_RW(GPIO_QSPI_SD1_EDGE_LOW, 14, 1)
3864 ADD_BITFIELD_RW(GPIO_QSPI_SD1_LEVEL_HIGH, 13, 1)
3865 ADD_BITFIELD_RW(GPIO_QSPI_SD1_LEVEL_LOW, 12, 1)
3866 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_HIGH, 11, 1)
3867 ADD_BITFIELD_RW(GPIO_QSPI_SD0_EDGE_LOW, 10, 1)
3868 ADD_BITFIELD_RW(GPIO_QSPI_SD0_LEVEL_HIGH, 9, 1)
3869 ADD_BITFIELD_RW(GPIO_QSPI_SD0_LEVEL_LOW, 8, 1)
3870 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_HIGH, 7, 1)
3871 ADD_BITFIELD_RW(GPIO_QSPI_SS_EDGE_LOW, 6, 1)
3872 ADD_BITFIELD_RW(GPIO_QSPI_SS_LEVEL_HIGH, 5, 1)
3873 ADD_BITFIELD_RW(GPIO_QSPI_SS_LEVEL_LOW, 4, 1)
3874 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_HIGH, 3, 1)
3875 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_EDGE_LOW, 2, 1)
3876 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_LEVEL_HIGH, 1, 1)
3877 ADD_BITFIELD_RW(GPIO_QSPI_SCLK_LEVEL_LOW, 0, 1)
3878 END_TYPE()
3879
3880 // Interrupt status after masking & forcing for dormant_wake
3881 // Reset value: 0x00000000
3882 BEGIN_TYPE(DORMANT_WAKE_INTS_t, uint32_t)
3883 ADD_BITFIELD_RO(GPIO_QSPI_SD3_EDGE_HIGH, 23, 1)
3884 ADD_BITFIELD_RO(GPIO_QSPI_SD3_EDGE_LOW, 22, 1)
3885 ADD_BITFIELD_RO(GPIO_QSPI_SD3_LEVEL_HIGH, 21, 1)
3886 ADD_BITFIELD_RO(GPIO_QSPI_SD3_LEVEL_LOW, 20, 1)
3887 ADD_BITFIELD_RO(GPIO_QSPI_SD2_EDGE_HIGH, 19, 1)
3888 ADD_BITFIELD_RO(GPIO_QSPI_SD2_EDGE_LOW, 18, 1)
3889 ADD_BITFIELD_RO(GPIO_QSPI_SD2_LEVEL_HIGH, 17, 1)
3890 ADD_BITFIELD_RO(GPIO_QSPI_SD2_LEVEL_LOW, 16, 1)
3891 ADD_BITFIELD_RO(GPIO_QSPI_SD1_EDGE_HIGH, 15, 1)
3892 ADD_BITFIELD_RO(GPIO_QSPI_SD1_EDGE_LOW, 14, 1)
3893 ADD_BITFIELD_RO(GPIO_QSPI_SD1_LEVEL_HIGH, 13, 1)
3894 ADD_BITFIELD_RO(GPIO_QSPI_SD1_LEVEL_LOW, 12, 1)
3895 ADD_BITFIELD_RO(GPIO_QSPI_SD0_EDGE_HIGH, 11, 1)
3896 ADD_BITFIELD_RO(GPIO_QSPI_SD0_EDGE_LOW, 10, 1)
3897 ADD_BITFIELD_RO(GPIO_QSPI_SD0_LEVEL_HIGH, 9, 1)
3898 ADD_BITFIELD_RO(GPIO_QSPI_SD0_LEVEL_LOW, 8, 1)
3899 ADD_BITFIELD_RO(GPIO_QSPI_SS_EDGE_HIGH, 7, 1)
3900 ADD_BITFIELD_RO(GPIO_QSPI_SS_EDGE_LOW, 6, 1)
3901 ADD_BITFIELD_RO(GPIO_QSPI_SS_LEVEL_HIGH, 5, 1)
3902 ADD_BITFIELD_RO(GPIO_QSPI_SS_LEVEL_LOW, 4, 1)
3903 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_EDGE_HIGH, 3, 1)
3904 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_EDGE_LOW, 2, 1)
3905 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_LEVEL_HIGH, 1, 1)
3906 ADD_BITFIELD_RO(GPIO_QSPI_SCLK_LEVEL_LOW, 0, 1)
3907 END_TYPE()
3908
3909 struct IO_QSPI_t {
3910 GPIO_QSPI_SCLK_STATUS_t GPIO_QSPI_SCLK_STATUS;
3911 GPIO_QSPI_SCLK_CTRL_t GPIO_QSPI_SCLK_CTRL;
3912 GPIO_QSPI_SS_STATUS_t GPIO_QSPI_SS_STATUS;
3913 GPIO_QSPI_SS_CTRL_t GPIO_QSPI_SS_CTRL;
3914 GPIO_QSPI_SD0_STATUS_t GPIO_QSPI_SD0_STATUS;
3915 GPIO_QSPI_SD0_CTRL_t GPIO_QSPI_SD0_CTRL;
3916 GPIO_QSPI_SD1_STATUS_t GPIO_QSPI_SD1_STATUS;
3917 GPIO_QSPI_SD1_CTRL_t GPIO_QSPI_SD1_CTRL;
3918 GPIO_QSPI_SD2_STATUS_t GPIO_QSPI_SD2_STATUS;
3919 GPIO_QSPI_SD2_CTRL_t GPIO_QSPI_SD2_CTRL;
3920 GPIO_QSPI_SD3_STATUS_t GPIO_QSPI_SD3_STATUS;
3921 GPIO_QSPI_SD3_CTRL_t GPIO_QSPI_SD3_CTRL;
3922 INTR_t INTR;
3923 PROC0_INTE_t PROC0_INTE;
3924 PROC0_INTF_t PROC0_INTF;
3925 PROC0_INTS_t PROC0_INTS;
3926 PROC1_INTE_t PROC1_INTE;
3927 PROC1_INTF_t PROC1_INTF;
3928 PROC1_INTS_t PROC1_INTS;
3929 DORMANT_WAKE_INTE_t DORMANT_WAKE_INTE;
3930 DORMANT_WAKE_INTF_t DORMANT_WAKE_INTF;
3931 DORMANT_WAKE_INTS_t DORMANT_WAKE_INTS;
3932 };
3933
3934 static IO_QSPI_t & IO_QSPI = (*(IO_QSPI_t *)0x40018000);
3935 static IO_QSPI_t & IO_QSPI_XOR = (*(IO_QSPI_t *)0x40019000);
3936 static IO_QSPI_t & IO_QSPI_SET = (*(IO_QSPI_t *)0x4001a000);
3937 static IO_QSPI_t & IO_QSPI_CLR = (*(IO_QSPI_t *)0x4001b000);
3938
3939} // _IO_QSPI_
3940
3941namespace _PADS_BANK0_ {
3942
3943 // Voltage select. Per bank control
3944 // Reset value: 0x00000000
3945 BEGIN_TYPE(VOLTAGE_SELECT_t, uint32_t)
3946 ADD_BITFIELD_RW(VOLTAGE_SELECT, 0, 1)
3947 END_TYPE()
3948
3949 // Set voltage to 3.3V (DVDD >= 2V5)
3950 static const uint32_t VOLTAGE_SELECT_VOLTAGE_SELECT__3v3 = 0;
3951 // Set voltage to 1.8V (DVDD <= 1V8)
3952 static const uint32_t VOLTAGE_SELECT_VOLTAGE_SELECT__1v8 = 1;
3953
3954 // Pad control register
3955 // Reset value: 0x00000056
3956 BEGIN_TYPE(GPIO_t, uint32_t)
3957 // Output disable. Has priority over output enable from peripherals
3958 ADD_BITFIELD_RW(OD, 7, 1)
3959 // Input enable
3960 ADD_BITFIELD_RW(IE, 6, 1)
3961 // Drive strength.
3962 ADD_BITFIELD_RW(DRIVE, 4, 2)
3963 // Pull up enable
3964 ADD_BITFIELD_RW(PUE, 3, 1)
3965 // Pull down enable
3966 ADD_BITFIELD_RW(PDE, 2, 1)
3967 // Enable schmitt trigger
3968 ADD_BITFIELD_RW(SCHMITT, 1, 1)
3969 // Slew rate control. 1 = Fast, 0 = Slow
3970 ADD_BITFIELD_RW(SLEWFAST, 0, 1)
3971 END_TYPE()
3972
3973 static const uint32_t GPIO_DRIVE__2mA = 0;
3974 static const uint32_t GPIO_DRIVE__4mA = 1;
3975 static const uint32_t GPIO_DRIVE__8mA = 2;
3976 static const uint32_t GPIO_DRIVE__12mA = 3;
3977
3978 // Pad control register
3979 // Reset value: 0x000000da
3980 BEGIN_TYPE(SWCLK_t, uint32_t)
3981 // Output disable. Has priority over output enable from peripherals
3982 ADD_BITFIELD_RW(OD, 7, 1)
3983 // Input enable
3984 ADD_BITFIELD_RW(IE, 6, 1)
3985 // Drive strength.
3986 ADD_BITFIELD_RW(DRIVE, 4, 2)
3987 // Pull up enable
3988 ADD_BITFIELD_RW(PUE, 3, 1)
3989 // Pull down enable
3990 ADD_BITFIELD_RW(PDE, 2, 1)
3991 // Enable schmitt trigger
3992 ADD_BITFIELD_RW(SCHMITT, 1, 1)
3993 // Slew rate control. 1 = Fast, 0 = Slow
3994 ADD_BITFIELD_RW(SLEWFAST, 0, 1)
3995 END_TYPE()
3996
3997 static const uint32_t SWCLK_DRIVE__2mA = 0;
3998 static const uint32_t SWCLK_DRIVE__4mA = 1;
3999 static const uint32_t SWCLK_DRIVE__8mA = 2;
4000 static const uint32_t SWCLK_DRIVE__12mA = 3;
4001
4002 // Pad control register
4003 // Reset value: 0x0000005a
4004 BEGIN_TYPE(SWD_t, uint32_t)
4005 // Output disable. Has priority over output enable from peripherals
4006 ADD_BITFIELD_RW(OD, 7, 1)
4007 // Input enable
4008 ADD_BITFIELD_RW(IE, 6, 1)
4009 // Drive strength.
4010 ADD_BITFIELD_RW(DRIVE, 4, 2)
4011 // Pull up enable
4012 ADD_BITFIELD_RW(PUE, 3, 1)
4013 // Pull down enable
4014 ADD_BITFIELD_RW(PDE, 2, 1)
4015 // Enable schmitt trigger
4016 ADD_BITFIELD_RW(SCHMITT, 1, 1)
4017 // Slew rate control. 1 = Fast, 0 = Slow
4018 ADD_BITFIELD_RW(SLEWFAST, 0, 1)
4019 END_TYPE()
4020
4021 static const uint32_t SWD_DRIVE__2mA = 0;
4022 static const uint32_t SWD_DRIVE__4mA = 1;
4023 static const uint32_t SWD_DRIVE__8mA = 2;
4024 static const uint32_t SWD_DRIVE__12mA = 3;
4025
4026 struct PADS_BANK0_t {
4027 VOLTAGE_SELECT_t VOLTAGE_SELECT;
4028 GPIO_t GPIO[30];
4029 SWCLK_t SWCLK;
4030 SWD_t SWD;
4031 };
4032
4033 static PADS_BANK0_t & PADS_BANK0 = (*(PADS_BANK0_t *)0x4001c000);
4034 static PADS_BANK0_t & PADS_BANK0_XOR = (*(PADS_BANK0_t *)0x4001d000);
4035 static PADS_BANK0_t & PADS_BANK0_SET = (*(PADS_BANK0_t *)0x4001e000);
4036 static PADS_BANK0_t & PADS_BANK0_CLR = (*(PADS_BANK0_t *)0x4001f000);
4037
4038} // _PADS_BANK0_
4039
4040namespace _PADS_QSPI_ {
4041
4042 // Voltage select. Per bank control
4043 // Reset value: 0x00000000
4044 BEGIN_TYPE(VOLTAGE_SELECT_t, uint32_t)
4045 ADD_BITFIELD_RW(VOLTAGE_SELECT, 0, 1)
4046 END_TYPE()
4047
4048 // Set voltage to 3.3V (DVDD >= 2V5)
4049 static const uint32_t VOLTAGE_SELECT_VOLTAGE_SELECT__3v3 = 0;
4050 // Set voltage to 1.8V (DVDD <= 1V8)
4051 static const uint32_t VOLTAGE_SELECT_VOLTAGE_SELECT__1v8 = 1;
4052
4053 // Pad control register
4054 // Reset value: 0x00000056
4055 BEGIN_TYPE(GPIO_QSPI_SCLK_t, uint32_t)
4056 // Output disable. Has priority over output enable from peripherals
4057 ADD_BITFIELD_RW(OD, 7, 1)
4058 // Input enable
4059 ADD_BITFIELD_RW(IE, 6, 1)
4060 // Drive strength.
4061 ADD_BITFIELD_RW(DRIVE, 4, 2)
4062 // Pull up enable
4063 ADD_BITFIELD_RW(PUE, 3, 1)
4064 // Pull down enable
4065 ADD_BITFIELD_RW(PDE, 2, 1)
4066 // Enable schmitt trigger
4067 ADD_BITFIELD_RW(SCHMITT, 1, 1)
4068 // Slew rate control. 1 = Fast, 0 = Slow
4069 ADD_BITFIELD_RW(SLEWFAST, 0, 1)
4070 END_TYPE()
4071
4072 static const uint32_t GPIO_QSPI_SCLK_DRIVE__2mA = 0;
4073 static const uint32_t GPIO_QSPI_SCLK_DRIVE__4mA = 1;
4074 static const uint32_t GPIO_QSPI_SCLK_DRIVE__8mA = 2;
4075 static const uint32_t GPIO_QSPI_SCLK_DRIVE__12mA = 3;
4076
4077 // Pad control register
4078 // Reset value: 0x00000052
4079 BEGIN_TYPE(GPIO_QSPI_SD0_t, uint32_t)
4080 // Output disable. Has priority over output enable from peripherals
4081 ADD_BITFIELD_RW(OD, 7, 1)
4082 // Input enable
4083 ADD_BITFIELD_RW(IE, 6, 1)
4084 // Drive strength.
4085 ADD_BITFIELD_RW(DRIVE, 4, 2)
4086 // Pull up enable
4087 ADD_BITFIELD_RW(PUE, 3, 1)
4088 // Pull down enable
4089 ADD_BITFIELD_RW(PDE, 2, 1)
4090 // Enable schmitt trigger
4091 ADD_BITFIELD_RW(SCHMITT, 1, 1)
4092 // Slew rate control. 1 = Fast, 0 = Slow
4093 ADD_BITFIELD_RW(SLEWFAST, 0, 1)
4094 END_TYPE()
4095
4096 static const uint32_t GPIO_QSPI_SD0_DRIVE__2mA = 0;
4097 static const uint32_t GPIO_QSPI_SD0_DRIVE__4mA = 1;
4098 static const uint32_t GPIO_QSPI_SD0_DRIVE__8mA = 2;
4099 static const uint32_t GPIO_QSPI_SD0_DRIVE__12mA = 3;
4100
4101 // Pad control register
4102 // Reset value: 0x00000052
4103 BEGIN_TYPE(GPIO_QSPI_SD1_t, uint32_t)
4104 // Output disable. Has priority over output enable from peripherals
4105 ADD_BITFIELD_RW(OD, 7, 1)
4106 // Input enable
4107 ADD_BITFIELD_RW(IE, 6, 1)
4108 // Drive strength.
4109 ADD_BITFIELD_RW(DRIVE, 4, 2)
4110 // Pull up enable
4111 ADD_BITFIELD_RW(PUE, 3, 1)
4112 // Pull down enable
4113 ADD_BITFIELD_RW(PDE, 2, 1)
4114 // Enable schmitt trigger
4115 ADD_BITFIELD_RW(SCHMITT, 1, 1)
4116 // Slew rate control. 1 = Fast, 0 = Slow
4117 ADD_BITFIELD_RW(SLEWFAST, 0, 1)
4118 END_TYPE()
4119
4120 static const uint32_t GPIO_QSPI_SD1_DRIVE__2mA = 0;
4121 static const uint32_t GPIO_QSPI_SD1_DRIVE__4mA = 1;
4122 static const uint32_t GPIO_QSPI_SD1_DRIVE__8mA = 2;
4123 static const uint32_t GPIO_QSPI_SD1_DRIVE__12mA = 3;
4124
4125 // Pad control register
4126 // Reset value: 0x00000052
4127 BEGIN_TYPE(GPIO_QSPI_SD2_t, uint32_t)
4128 // Output disable. Has priority over output enable from peripherals
4129 ADD_BITFIELD_RW(OD, 7, 1)
4130 // Input enable
4131 ADD_BITFIELD_RW(IE, 6, 1)
4132 // Drive strength.
4133 ADD_BITFIELD_RW(DRIVE, 4, 2)
4134 // Pull up enable
4135 ADD_BITFIELD_RW(PUE, 3, 1)
4136 // Pull down enable
4137 ADD_BITFIELD_RW(PDE, 2, 1)
4138 // Enable schmitt trigger
4139 ADD_BITFIELD_RW(SCHMITT, 1, 1)
4140 // Slew rate control. 1 = Fast, 0 = Slow
4141 ADD_BITFIELD_RW(SLEWFAST, 0, 1)
4142 END_TYPE()
4143
4144 static const uint32_t GPIO_QSPI_SD2_DRIVE__2mA = 0;
4145 static const uint32_t GPIO_QSPI_SD2_DRIVE__4mA = 1;
4146 static const uint32_t GPIO_QSPI_SD2_DRIVE__8mA = 2;
4147 static const uint32_t GPIO_QSPI_SD2_DRIVE__12mA = 3;
4148
4149 // Pad control register
4150 // Reset value: 0x00000052
4151 BEGIN_TYPE(GPIO_QSPI_SD3_t, uint32_t)
4152 // Output disable. Has priority over output enable from peripherals
4153 ADD_BITFIELD_RW(OD, 7, 1)
4154 // Input enable
4155 ADD_BITFIELD_RW(IE, 6, 1)
4156 // Drive strength.
4157 ADD_BITFIELD_RW(DRIVE, 4, 2)
4158 // Pull up enable
4159 ADD_BITFIELD_RW(PUE, 3, 1)
4160 // Pull down enable
4161 ADD_BITFIELD_RW(PDE, 2, 1)
4162 // Enable schmitt trigger
4163 ADD_BITFIELD_RW(SCHMITT, 1, 1)
4164 // Slew rate control. 1 = Fast, 0 = Slow
4165 ADD_BITFIELD_RW(SLEWFAST, 0, 1)
4166 END_TYPE()
4167
4168 static const uint32_t GPIO_QSPI_SD3_DRIVE__2mA = 0;
4169 static const uint32_t GPIO_QSPI_SD3_DRIVE__4mA = 1;
4170 static const uint32_t GPIO_QSPI_SD3_DRIVE__8mA = 2;
4171 static const uint32_t GPIO_QSPI_SD3_DRIVE__12mA = 3;
4172
4173 // Pad control register
4174 // Reset value: 0x0000005a
4175 BEGIN_TYPE(GPIO_QSPI_SS_t, uint32_t)
4176 // Output disable. Has priority over output enable from peripherals
4177 ADD_BITFIELD_RW(OD, 7, 1)
4178 // Input enable
4179 ADD_BITFIELD_RW(IE, 6, 1)
4180 // Drive strength.
4181 ADD_BITFIELD_RW(DRIVE, 4, 2)
4182 // Pull up enable
4183 ADD_BITFIELD_RW(PUE, 3, 1)
4184 // Pull down enable
4185 ADD_BITFIELD_RW(PDE, 2, 1)
4186 // Enable schmitt trigger
4187 ADD_BITFIELD_RW(SCHMITT, 1, 1)
4188 // Slew rate control. 1 = Fast, 0 = Slow
4189 ADD_BITFIELD_RW(SLEWFAST, 0, 1)
4190 END_TYPE()
4191
4192 static const uint32_t GPIO_QSPI_SS_DRIVE__2mA = 0;
4193 static const uint32_t GPIO_QSPI_SS_DRIVE__4mA = 1;
4194 static const uint32_t GPIO_QSPI_SS_DRIVE__8mA = 2;
4195 static const uint32_t GPIO_QSPI_SS_DRIVE__12mA = 3;
4196
4197 struct PADS_QSPI_t {
4198 VOLTAGE_SELECT_t VOLTAGE_SELECT;
4199 GPIO_QSPI_SCLK_t GPIO_QSPI_SCLK;
4200 GPIO_QSPI_SD0_t GPIO_QSPI_SD0;
4201 GPIO_QSPI_SD1_t GPIO_QSPI_SD1;
4202 GPIO_QSPI_SD2_t GPIO_QSPI_SD2;
4203 GPIO_QSPI_SD3_t GPIO_QSPI_SD3;
4204 GPIO_QSPI_SS_t GPIO_QSPI_SS;
4205 };
4206
4207 static PADS_QSPI_t & PADS_QSPI = (*(PADS_QSPI_t *)0x40020000);
4208 static PADS_QSPI_t & PADS_QSPI_XOR = (*(PADS_QSPI_t *)0x40021000);
4209 static PADS_QSPI_t & PADS_QSPI_SET = (*(PADS_QSPI_t *)0x40022000);
4210 static PADS_QSPI_t & PADS_QSPI_CLR = (*(PADS_QSPI_t *)0x40023000);
4211
4212} // _PADS_QSPI_
4213
4214// Controls the crystal oscillator
4215namespace _XOSC_ {
4216
4217 // Crystal Oscillator Control
4218 // Reset value: 0x00000000
4219 BEGIN_TYPE(CTRL_t, uint32_t)
4220 // On power-up this field is initialised to DISABLE and the chip runs from the ROSC.
4221 // If the chip has subsequently been programmed to run from the XOSC then setting this field to DISABLE may lock-up the chip. If this is a concern then run the clk_ref from the ROSC and enable the clk_sys RESUS feature.
4222 // The 12-bit code is intended to give some protection against accidental writes. An invalid setting will enable the oscillator.
4223 ADD_BITFIELD_RW(ENABLE, 12, 12)
4224 // Frequency range. This resets to 0xAA0 and cannot be changed.
4225 ADD_BITFIELD_RW(FREQ_RANGE, 0, 12)
4226 END_TYPE()
4227
4228 static const uint32_t CTRL_ENABLE__DISABLE = 3358;
4229 static const uint32_t CTRL_ENABLE__ENABLE = 4011;
4230 static const uint32_t CTRL_FREQ_RANGE__1_15MHZ = 2720;
4231 static const uint32_t CTRL_FREQ_RANGE__RESERVED_1 = 2721;
4232 static const uint32_t CTRL_FREQ_RANGE__RESERVED_2 = 2722;
4233 static const uint32_t CTRL_FREQ_RANGE__RESERVED_3 = 2723;
4234
4235 // Crystal Oscillator Status
4236 // Reset value: 0x00000000
4237 BEGIN_TYPE(STATUS_t, uint32_t)
4238 // Oscillator is running and stable
4239 ADD_BITFIELD_RO(STABLE, 31, 1)
4240 // An invalid value has been written to CTRL_ENABLE or CTRL_FREQ_RANGE or DORMANT
4241 ADD_BITFIELD_RW(BADWRITE, 24, 1)
4242 // Oscillator is enabled but not necessarily running and stable, resets to 0
4243 ADD_BITFIELD_RO(ENABLED, 12, 1)
4244 // The current frequency range setting, always reads 0
4245 ADD_BITFIELD_RO(FREQ_RANGE, 0, 2)
4246 END_TYPE()
4247
4248 static const uint32_t STATUS_FREQ_RANGE__1_15MHZ = 0;
4249 static const uint32_t STATUS_FREQ_RANGE__RESERVED_1 = 1;
4250 static const uint32_t STATUS_FREQ_RANGE__RESERVED_2 = 2;
4251 static const uint32_t STATUS_FREQ_RANGE__RESERVED_3 = 3;
4252
4253 // Crystal Oscillator pause control
4254 // This is used to save power by pausing the XOSC
4255 // On power-up this field is initialised to WAKE
4256 // An invalid write will also select WAKE
4257 // WARNING: stop the PLLs before selecting dormant mode
4258 // WARNING: setup the irq before selecting dormant mode
4259 // Reset value: 0x00000000
4260 typedef uint32_t DORMANT_t;
4261
4262 // Controls the startup delay
4263 // Reset value: 0x000000c4
4264 BEGIN_TYPE(STARTUP_t, uint32_t)
4265 // Multiplies the startup_delay by 4. This is of little value to the user given that the delay can be programmed directly.
4266 ADD_BITFIELD_RW(X4, 20, 1)
4267 // in multiples of 256*xtal_period. The reset value of 0xc4 corresponds to approx 50 000 cycles.
4268 ADD_BITFIELD_RW(DELAY, 0, 14)
4269 END_TYPE()
4270
4271 // A down counter running at the xosc frequency which counts to zero and stops.
4272 // To start the counter write a non-zero value.
4273 // Can be used for short software pauses when setting up time sensitive hardware.
4274 // Reset value: 0x00000000
4275 BEGIN_TYPE(COUNT_t, uint32_t)
4276 ADD_BITFIELD_RW(COUNT, 0, 8)
4277 END_TYPE()
4278
4279 struct XOSC_t {
4280 CTRL_t CTRL;
4281 STATUS_t STATUS;
4282 DORMANT_t DORMANT;
4283 STARTUP_t STARTUP;
4284 uint32_t reserved0[3];
4285 COUNT_t COUNT;
4286 };
4287
4288 static XOSC_t & XOSC = (*(XOSC_t *)0x40024000);
4289 static XOSC_t & XOSC_XOR = (*(XOSC_t *)0x40025000);
4290 static XOSC_t & XOSC_SET = (*(XOSC_t *)0x40026000);
4291 static XOSC_t & XOSC_CLR = (*(XOSC_t *)0x40027000);
4292
4293} // _XOSC_
4294
4295namespace _PLL_SYS_ {
4296
4297 // Control and Status
4298 // GENERAL CONSTRAINTS:
4299 // Reference clock frequency min=5MHz, max=800MHz
4300 // Feedback divider min=16, max=320
4301 // VCO frequency min=750MHz, max=1600MHz
4302 // Reset value: 0x00000001
4303 BEGIN_TYPE(CS_t, uint32_t)
4304 // PLL is locked
4305 ADD_BITFIELD_RO(LOCK, 31, 1)
4306 // Passes the reference clock to the output instead of the divided VCO. The VCO continues to run so the user can switch between the reference clock and the divided VCO but the output will glitch when doing so.
4307 ADD_BITFIELD_RW(BYPASS, 8, 1)
4308 // Divides the PLL input reference clock.
4309 // Behaviour is undefined for div=0.
4310 // PLL output will be unpredictable during refdiv changes, wait for lock=1 before using it.
4311 ADD_BITFIELD_RW(REFDIV, 0, 6)
4312 END_TYPE()
4313
4314 // Controls the PLL power modes.
4315 // Reset value: 0x0000002d
4316 BEGIN_TYPE(PWR_t, uint32_t)
4317 // PLL VCO powerdown
4318 // To save power set high when PLL output not required or bypass=1.
4319 ADD_BITFIELD_RW(VCOPD, 5, 1)
4320 // PLL post divider powerdown
4321 // To save power set high when PLL output not required or bypass=1.
4322 ADD_BITFIELD_RW(POSTDIVPD, 3, 1)
4323 // PLL DSM powerdown
4324 // Nothing is achieved by setting this low.
4325 ADD_BITFIELD_RW(DSMPD, 2, 1)
4326 // PLL powerdown
4327 // To save power set high when PLL output not required.
4328 ADD_BITFIELD_RW(PD, 0, 1)
4329 END_TYPE()
4330
4331 // Feedback divisor
4332 // (note: this PLL does not support fractional division)
4333 // Reset value: 0x00000000
4334 BEGIN_TYPE(FBDIV_INT_t, uint32_t)
4335 // see ctrl reg description for constraints
4336 ADD_BITFIELD_RW(FBDIV_INT, 0, 12)
4337 END_TYPE()
4338
4339 // Controls the PLL post dividers for the primary output
4340 // (note: this PLL does not have a secondary output)
4341 // the primary output is driven from VCO divided by postdiv1*postdiv2
4342 // Reset value: 0x00077000
4343 BEGIN_TYPE(PRIM_t, uint32_t)
4344 // divide by 1-7
4345 ADD_BITFIELD_RW(POSTDIV1, 16, 3)
4346 // divide by 1-7
4347 ADD_BITFIELD_RW(POSTDIV2, 12, 3)
4348 END_TYPE()
4349
4350 struct PLL_SYS_t {
4351 CS_t CS;
4352 PWR_t PWR;
4353 FBDIV_INT_t FBDIV_INT;
4354 PRIM_t PRIM;
4355 };
4356
4357 static PLL_SYS_t & PLL_SYS = (*(PLL_SYS_t *)0x40028000);
4358 static PLL_SYS_t & PLL_SYS_XOR = (*(PLL_SYS_t *)0x40029000);
4359 static PLL_SYS_t & PLL_SYS_SET = (*(PLL_SYS_t *)0x4002a000);
4360 static PLL_SYS_t & PLL_SYS_CLR = (*(PLL_SYS_t *)0x4002b000);
4361
4362} // _PLL_SYS_
4363
4364namespace _PLL_USB_ {
4365
4366 static _PLL_SYS_::PLL_SYS_t & PLL_USB = (*(_PLL_SYS_::PLL_SYS_t *)0x4002c000);
4367 static _PLL_SYS_::PLL_SYS_t & PLL_USB_XOR = (*(_PLL_SYS_::PLL_SYS_t *)0x4002d000);
4368 static _PLL_SYS_::PLL_SYS_t & PLL_USB_SET = (*(_PLL_SYS_::PLL_SYS_t *)0x4002e000);
4369 static _PLL_SYS_::PLL_SYS_t & PLL_USB_CLR = (*(_PLL_SYS_::PLL_SYS_t *)0x4002f000);
4370
4371} // _PLL_USB_
4372
4373// Register block for busfabric control signals and performance counters
4374namespace _BUSCTRL_ {
4375
4376 // Set the priority of each master for bus arbitration.
4377 // Reset value: 0x00000000
4378 BEGIN_TYPE(BUS_PRIORITY_t, uint32_t)
4379 // 0 - low priority, 1 - high priority
4380 ADD_BITFIELD_RW(DMA_W, 12, 1)
4381 // 0 - low priority, 1 - high priority
4382 ADD_BITFIELD_RW(DMA_R, 8, 1)
4383 // 0 - low priority, 1 - high priority
4384 ADD_BITFIELD_RW(PROC1, 4, 1)
4385 // 0 - low priority, 1 - high priority
4386 ADD_BITFIELD_RW(PROC0, 0, 1)
4387 END_TYPE()
4388
4389 // Bus priority acknowledge
4390 // Reset value: 0x00000000
4391 BEGIN_TYPE(BUS_PRIORITY_ACK_t, uint32_t)
4392 // Goes to 1 once all arbiters have registered the new global priority levels.
4393 // Arbiters update their local priority when servicing a new nonsequential access.
4394 // In normal circumstances this will happen almost immediately.
4395 ADD_BITFIELD_RO(BUS_PRIORITY_ACK, 0, 1)
4396 END_TYPE()
4397
4398 // Bus fabric performance counter 0
4399 // Reset value: 0x00000000
4400 BEGIN_TYPE(PERFCTR0_t, uint32_t)
4401 // Busfabric saturating performance counter 0
4402 // Count some event signal from the busfabric arbiters.
4403 // Write any value to clear. Select an event to count using PERFSEL0
4404 ADD_BITFIELD_RW(PERFCTR0, 0, 24)
4405 END_TYPE()
4406
4407 // Bus fabric performance event select for PERFCTR0
4408 // Reset value: 0x0000001f
4409 BEGIN_TYPE(PERFSEL0_t, uint32_t)
4410 // Select an event for PERFCTR0. Count either contested accesses, or all accesses, on a downstream port of the main crossbar.
4411 ADD_BITFIELD_RW(PERFSEL0, 0, 5)
4412 END_TYPE()
4413
4414 static const uint32_t PERFSEL0_PERFSEL0__apb_contested = 0;
4415 static const uint32_t PERFSEL0_PERFSEL0__apb = 1;
4416 static const uint32_t PERFSEL0_PERFSEL0__fastperi_contested = 2;
4417 static const uint32_t PERFSEL0_PERFSEL0__fastperi = 3;
4418 static const uint32_t PERFSEL0_PERFSEL0__sram5_contested = 4;
4419 static const uint32_t PERFSEL0_PERFSEL0__sram5 = 5;
4420 static const uint32_t PERFSEL0_PERFSEL0__sram4_contested = 6;
4421 static const uint32_t PERFSEL0_PERFSEL0__sram4 = 7;
4422 static const uint32_t PERFSEL0_PERFSEL0__sram3_contested = 8;
4423 static const uint32_t PERFSEL0_PERFSEL0__sram3 = 9;
4424 static const uint32_t PERFSEL0_PERFSEL0__sram2_contested = 10;
4425 static const uint32_t PERFSEL0_PERFSEL0__sram2 = 11;
4426 static const uint32_t PERFSEL0_PERFSEL0__sram1_contested = 12;
4427 static const uint32_t PERFSEL0_PERFSEL0__sram1 = 13;
4428 static const uint32_t PERFSEL0_PERFSEL0__sram0_contested = 14;
4429 static const uint32_t PERFSEL0_PERFSEL0__sram0 = 15;
4430 static const uint32_t PERFSEL0_PERFSEL0__xip_main_contested = 16;
4431 static const uint32_t PERFSEL0_PERFSEL0__xip_main = 17;
4432 static const uint32_t PERFSEL0_PERFSEL0__rom_contested = 18;
4433 static const uint32_t PERFSEL0_PERFSEL0__rom = 19;
4434
4435 // Bus fabric performance counter 1
4436 // Reset value: 0x00000000
4437 BEGIN_TYPE(PERFCTR1_t, uint32_t)
4438 // Busfabric saturating performance counter 1
4439 // Count some event signal from the busfabric arbiters.
4440 // Write any value to clear. Select an event to count using PERFSEL1
4441 ADD_BITFIELD_RW(PERFCTR1, 0, 24)
4442 END_TYPE()
4443
4444 // Bus fabric performance event select for PERFCTR1
4445 // Reset value: 0x0000001f
4446 BEGIN_TYPE(PERFSEL1_t, uint32_t)
4447 // Select an event for PERFCTR1. Count either contested accesses, or all accesses, on a downstream port of the main crossbar.
4448 ADD_BITFIELD_RW(PERFSEL1, 0, 5)
4449 END_TYPE()
4450
4451 static const uint32_t PERFSEL1_PERFSEL1__apb_contested = 0;
4452 static const uint32_t PERFSEL1_PERFSEL1__apb = 1;
4453 static const uint32_t PERFSEL1_PERFSEL1__fastperi_contested = 2;
4454 static const uint32_t PERFSEL1_PERFSEL1__fastperi = 3;
4455 static const uint32_t PERFSEL1_PERFSEL1__sram5_contested = 4;
4456 static const uint32_t PERFSEL1_PERFSEL1__sram5 = 5;
4457 static const uint32_t PERFSEL1_PERFSEL1__sram4_contested = 6;
4458 static const uint32_t PERFSEL1_PERFSEL1__sram4 = 7;
4459 static const uint32_t PERFSEL1_PERFSEL1__sram3_contested = 8;
4460 static const uint32_t PERFSEL1_PERFSEL1__sram3 = 9;
4461 static const uint32_t PERFSEL1_PERFSEL1__sram2_contested = 10;
4462 static const uint32_t PERFSEL1_PERFSEL1__sram2 = 11;
4463 static const uint32_t PERFSEL1_PERFSEL1__sram1_contested = 12;
4464 static const uint32_t PERFSEL1_PERFSEL1__sram1 = 13;
4465 static const uint32_t PERFSEL1_PERFSEL1__sram0_contested = 14;
4466 static const uint32_t PERFSEL1_PERFSEL1__sram0 = 15;
4467 static const uint32_t PERFSEL1_PERFSEL1__xip_main_contested = 16;
4468 static const uint32_t PERFSEL1_PERFSEL1__xip_main = 17;
4469 static const uint32_t PERFSEL1_PERFSEL1__rom_contested = 18;
4470 static const uint32_t PERFSEL1_PERFSEL1__rom = 19;
4471
4472 // Bus fabric performance counter 2
4473 // Reset value: 0x00000000
4474 BEGIN_TYPE(PERFCTR2_t, uint32_t)
4475 // Busfabric saturating performance counter 2
4476 // Count some event signal from the busfabric arbiters.
4477 // Write any value to clear. Select an event to count using PERFSEL2
4478 ADD_BITFIELD_RW(PERFCTR2, 0, 24)
4479 END_TYPE()
4480
4481 // Bus fabric performance event select for PERFCTR2
4482 // Reset value: 0x0000001f
4483 BEGIN_TYPE(PERFSEL2_t, uint32_t)
4484 // Select an event for PERFCTR2. Count either contested accesses, or all accesses, on a downstream port of the main crossbar.
4485 ADD_BITFIELD_RW(PERFSEL2, 0, 5)
4486 END_TYPE()
4487
4488 static const uint32_t PERFSEL2_PERFSEL2__apb_contested = 0;
4489 static const uint32_t PERFSEL2_PERFSEL2__apb = 1;
4490 static const uint32_t PERFSEL2_PERFSEL2__fastperi_contested = 2;
4491 static const uint32_t PERFSEL2_PERFSEL2__fastperi = 3;
4492 static const uint32_t PERFSEL2_PERFSEL2__sram5_contested = 4;
4493 static const uint32_t PERFSEL2_PERFSEL2__sram5 = 5;
4494 static const uint32_t PERFSEL2_PERFSEL2__sram4_contested = 6;
4495 static const uint32_t PERFSEL2_PERFSEL2__sram4 = 7;
4496 static const uint32_t PERFSEL2_PERFSEL2__sram3_contested = 8;
4497 static const uint32_t PERFSEL2_PERFSEL2__sram3 = 9;
4498 static const uint32_t PERFSEL2_PERFSEL2__sram2_contested = 10;
4499 static const uint32_t PERFSEL2_PERFSEL2__sram2 = 11;
4500 static const uint32_t PERFSEL2_PERFSEL2__sram1_contested = 12;
4501 static const uint32_t PERFSEL2_PERFSEL2__sram1 = 13;
4502 static const uint32_t PERFSEL2_PERFSEL2__sram0_contested = 14;
4503 static const uint32_t PERFSEL2_PERFSEL2__sram0 = 15;
4504 static const uint32_t PERFSEL2_PERFSEL2__xip_main_contested = 16;
4505 static const uint32_t PERFSEL2_PERFSEL2__xip_main = 17;
4506 static const uint32_t PERFSEL2_PERFSEL2__rom_contested = 18;
4507 static const uint32_t PERFSEL2_PERFSEL2__rom = 19;
4508
4509 // Bus fabric performance counter 3
4510 // Reset value: 0x00000000
4511 BEGIN_TYPE(PERFCTR3_t, uint32_t)
4512 // Busfabric saturating performance counter 3
4513 // Count some event signal from the busfabric arbiters.
4514 // Write any value to clear. Select an event to count using PERFSEL3
4515 ADD_BITFIELD_RW(PERFCTR3, 0, 24)
4516 END_TYPE()
4517
4518 // Bus fabric performance event select for PERFCTR3
4519 // Reset value: 0x0000001f
4520 BEGIN_TYPE(PERFSEL3_t, uint32_t)
4521 // Select an event for PERFCTR3. Count either contested accesses, or all accesses, on a downstream port of the main crossbar.
4522 ADD_BITFIELD_RW(PERFSEL3, 0, 5)
4523 END_TYPE()
4524
4525 static const uint32_t PERFSEL3_PERFSEL3__apb_contested = 0;
4526 static const uint32_t PERFSEL3_PERFSEL3__apb = 1;
4527 static const uint32_t PERFSEL3_PERFSEL3__fastperi_contested = 2;
4528 static const uint32_t PERFSEL3_PERFSEL3__fastperi = 3;
4529 static const uint32_t PERFSEL3_PERFSEL3__sram5_contested = 4;
4530 static const uint32_t PERFSEL3_PERFSEL3__sram5 = 5;
4531 static const uint32_t PERFSEL3_PERFSEL3__sram4_contested = 6;
4532 static const uint32_t PERFSEL3_PERFSEL3__sram4 = 7;
4533 static const uint32_t PERFSEL3_PERFSEL3__sram3_contested = 8;
4534 static const uint32_t PERFSEL3_PERFSEL3__sram3 = 9;
4535 static const uint32_t PERFSEL3_PERFSEL3__sram2_contested = 10;
4536 static const uint32_t PERFSEL3_PERFSEL3__sram2 = 11;
4537 static const uint32_t PERFSEL3_PERFSEL3__sram1_contested = 12;
4538 static const uint32_t PERFSEL3_PERFSEL3__sram1 = 13;
4539 static const uint32_t PERFSEL3_PERFSEL3__sram0_contested = 14;
4540 static const uint32_t PERFSEL3_PERFSEL3__sram0 = 15;
4541 static const uint32_t PERFSEL3_PERFSEL3__xip_main_contested = 16;
4542 static const uint32_t PERFSEL3_PERFSEL3__xip_main = 17;
4543 static const uint32_t PERFSEL3_PERFSEL3__rom_contested = 18;
4544 static const uint32_t PERFSEL3_PERFSEL3__rom = 19;
4545
4546 struct BUSCTRL_t {
4547 BUS_PRIORITY_t BUS_PRIORITY;
4548 BUS_PRIORITY_ACK_t BUS_PRIORITY_ACK;
4549 PERFCTR0_t PERFCTR0;
4550 PERFSEL0_t PERFSEL0;
4551 PERFCTR1_t PERFCTR1;
4552 PERFSEL1_t PERFSEL1;
4553 PERFCTR2_t PERFCTR2;
4554 PERFSEL2_t PERFSEL2;
4555 PERFCTR3_t PERFCTR3;
4556 PERFSEL3_t PERFSEL3;
4557 };
4558
4559 static BUSCTRL_t & BUSCTRL = (*(BUSCTRL_t *)0x40030000);
4560 static BUSCTRL_t & BUSCTRL_XOR = (*(BUSCTRL_t *)0x40031000);
4561 static BUSCTRL_t & BUSCTRL_SET = (*(BUSCTRL_t *)0x40032000);
4562 static BUSCTRL_t & BUSCTRL_CLR = (*(BUSCTRL_t *)0x40033000);
4563
4564} // _BUSCTRL_
4565
4566namespace _UART0_ {
4567
4568 // Data Register, UARTDR
4569 // Reset value: 0x00000000
4570 BEGIN_TYPE(UARTDR_t, uint32_t)
4571 // Overrun error. This bit is set to 1 if data is received and the receive FIFO is already full. This is cleared to 0 once there is an empty space in the FIFO and a new character can be written to it.
4572 ADD_BITFIELD_RO(OE, 11, 1)
4573 // Break error. This bit is set to 1 if a break condition was detected, indicating that the received data input was held LOW for longer than a full-word transmission time (defined as start, data, parity and stop bits). In FIFO mode, this error is associated with the character at the top of the FIFO. When a break occurs, only one 0 character is loaded into the FIFO. The next character is only enabled after the receive data input goes to a 1 (marking state), and the next valid start bit is received.
4574 ADD_BITFIELD_RO(BE, 10, 1)
4575 // Parity error. When set to 1, it indicates that the parity of the received data character does not match the parity that the EPS and SPS bits in the Line Control Register, UARTLCR_H. In FIFO mode, this error is associated with the character at the top of the FIFO.
4576 ADD_BITFIELD_RO(PE, 9, 1)
4577 // Framing error. When set to 1, it indicates that the received character did not have a valid stop bit (a valid stop bit is 1). In FIFO mode, this error is associated with the character at the top of the FIFO.
4578 ADD_BITFIELD_RO(FE, 8, 1)
4579 // Receive (read) data character. Transmit (write) data character.
4580 ADD_BITFIELD_RW(DATA, 0, 8)
4581 END_TYPE()
4582
4583 // Receive Status Register/Error Clear Register, UARTRSR/UARTECR
4584 // Reset value: 0x00000000
4585 BEGIN_TYPE(UARTRSR_t, uint32_t)
4586 // Overrun error. This bit is set to 1 if data is received and the FIFO is already full. This bit is cleared to 0 by a write to UARTECR. The FIFO contents remain valid because no more data is written when the FIFO is full, only the contents of the shift register are overwritten. The CPU must now read the data, to empty the FIFO.
4587 ADD_BITFIELD_RW(OE, 3, 1)
4588 // Break error. This bit is set to 1 if a break condition was detected, indicating that the received data input was held LOW for longer than a full-word transmission time (defined as start, data, parity, and stop bits). This bit is cleared to 0 after a write to UARTECR. In FIFO mode, this error is associated with the character at the top of the FIFO. When a break occurs, only one 0 character is loaded into the FIFO. The next character is only enabled after the receive data input goes to a 1 (marking state) and the next valid start bit is received.
4589 ADD_BITFIELD_RW(BE, 2, 1)
4590 // Parity error. When set to 1, it indicates that the parity of the received data character does not match the parity that the EPS and SPS bits in the Line Control Register, UARTLCR_H. This bit is cleared to 0 by a write to UARTECR. In FIFO mode, this error is associated with the character at the top of the FIFO.
4591 ADD_BITFIELD_RW(PE, 1, 1)
4592 // Framing error. When set to 1, it indicates that the received character did not have a valid stop bit (a valid stop bit is 1). This bit is cleared to 0 by a write to UARTECR. In FIFO mode, this error is associated with the character at the top of the FIFO.
4593 ADD_BITFIELD_RW(FE, 0, 1)
4594 END_TYPE()
4595
4596 // Flag Register, UARTFR
4597 // Reset value: 0x00000090
4598 BEGIN_TYPE(UARTFR_t, uint32_t)
4599 // Ring indicator. This bit is the complement of the UART ring indicator, nUARTRI, modem status input. That is, the bit is 1 when nUARTRI is LOW.
4600 ADD_BITFIELD_RO(RI, 8, 1)
4601 // Transmit FIFO empty. The meaning of this bit depends on the state of the FEN bit in the Line Control Register, UARTLCR_H. If the FIFO is disabled, this bit is set when the transmit holding register is empty. If the FIFO is enabled, the TXFE bit is set when the transmit FIFO is empty. This bit does not indicate if there is data in the transmit shift register.
4602 ADD_BITFIELD_RO(TXFE, 7, 1)
4603 // Receive FIFO full. The meaning of this bit depends on the state of the FEN bit in the UARTLCR_H Register. If the FIFO is disabled, this bit is set when the receive holding register is full. If the FIFO is enabled, the RXFF bit is set when the receive FIFO is full.
4604 ADD_BITFIELD_RO(RXFF, 6, 1)
4605 // Transmit FIFO full. The meaning of this bit depends on the state of the FEN bit in the UARTLCR_H Register. If the FIFO is disabled, this bit is set when the transmit holding register is full. If the FIFO is enabled, the TXFF bit is set when the transmit FIFO is full.
4606 ADD_BITFIELD_RO(TXFF, 5, 1)
4607 // Receive FIFO empty. The meaning of this bit depends on the state of the FEN bit in the UARTLCR_H Register. If the FIFO is disabled, this bit is set when the receive holding register is empty. If the FIFO is enabled, the RXFE bit is set when the receive FIFO is empty.
4608 ADD_BITFIELD_RO(RXFE, 4, 1)
4609 // UART busy. If this bit is set to 1, the UART is busy transmitting data. This bit remains set until the complete byte, including all the stop bits, has been sent from the shift register. This bit is set as soon as the transmit FIFO becomes non-empty, regardless of whether the UART is enabled or not.
4610 ADD_BITFIELD_RO(BUSY, 3, 1)
4611 // Data carrier detect. This bit is the complement of the UART data carrier detect, nUARTDCD, modem status input. That is, the bit is 1 when nUARTDCD is LOW.
4612 ADD_BITFIELD_RO(DCD, 2, 1)
4613 // Data set ready. This bit is the complement of the UART data set ready, nUARTDSR, modem status input. That is, the bit is 1 when nUARTDSR is LOW.
4614 ADD_BITFIELD_RO(DSR, 1, 1)
4615 // Clear to send. This bit is the complement of the UART clear to send, nUARTCTS, modem status input. That is, the bit is 1 when nUARTCTS is LOW.
4616 ADD_BITFIELD_RO(CTS, 0, 1)
4617 END_TYPE()
4618
4619 // IrDA Low-Power Counter Register, UARTILPR
4620 // Reset value: 0x00000000
4621 BEGIN_TYPE(UARTILPR_t, uint32_t)
4622 // 8-bit low-power divisor value. These bits are cleared to 0 at reset.
4623 ADD_BITFIELD_RW(ILPDVSR, 0, 8)
4624 END_TYPE()
4625
4626 // Integer Baud Rate Register, UARTIBRD
4627 // Reset value: 0x00000000
4628 BEGIN_TYPE(UARTIBRD_t, uint32_t)
4629 // The integer baud rate divisor. These bits are cleared to 0 on reset.
4630 ADD_BITFIELD_RW(BAUD_DIVINT, 0, 16)
4631 END_TYPE()
4632
4633 // Fractional Baud Rate Register, UARTFBRD
4634 // Reset value: 0x00000000
4635 BEGIN_TYPE(UARTFBRD_t, uint32_t)
4636 // The fractional baud rate divisor. These bits are cleared to 0 on reset.
4637 ADD_BITFIELD_RW(BAUD_DIVFRAC, 0, 6)
4638 END_TYPE()
4639
4640 // Line Control Register, UARTLCR_H
4641 // Reset value: 0x00000000
4642 BEGIN_TYPE(UARTLCR_H_t, uint32_t)
4643 // Stick parity select. 0 = stick parity is disabled 1 = either: * if the EPS bit is 0 then the parity bit is transmitted and checked as a 1 * if the EPS bit is 1 then the parity bit is transmitted and checked as a 0. This bit has no effect when the PEN bit disables parity checking and generation.
4644 ADD_BITFIELD_RW(SPS, 7, 1)
4645 // Word length. These bits indicate the number of data bits transmitted or received in a frame as follows: b11 = 8 bits b10 = 7 bits b01 = 6 bits b00 = 5 bits.
4646 ADD_BITFIELD_RW(WLEN, 5, 2)
4647 // Enable FIFOs: 0 = FIFOs are disabled (character mode) that is, the FIFOs become 1-byte-deep holding registers 1 = transmit and receive FIFO buffers are enabled (FIFO mode).
4648 ADD_BITFIELD_RW(FEN, 4, 1)
4649 // Two stop bits select. If this bit is set to 1, two stop bits are transmitted at the end of the frame. The receive logic does not check for two stop bits being received.
4650 ADD_BITFIELD_RW(STP2, 3, 1)
4651 // Even parity select. Controls the type of parity the UART uses during transmission and reception: 0 = odd parity. The UART generates or checks for an odd number of 1s in the data and parity bits. 1 = even parity. The UART generates or checks for an even number of 1s in the data and parity bits. This bit has no effect when the PEN bit disables parity checking and generation.
4652 ADD_BITFIELD_RW(EPS, 2, 1)
4653 // Parity enable: 0 = parity is disabled and no parity bit added to the data frame 1 = parity checking and generation is enabled.
4654 ADD_BITFIELD_RW(PEN, 1, 1)
4655 // Send break. If this bit is set to 1, a low-level is continually output on the UARTTXD output, after completing transmission of the current character. For the proper execution of the break command, the software must set this bit for at least two complete frames. For normal use, this bit must be cleared to 0.
4656 ADD_BITFIELD_RW(BRK, 0, 1)
4657 END_TYPE()
4658
4659 // Control Register, UARTCR
4660 // Reset value: 0x00000300
4661 BEGIN_TYPE(UARTCR_t, uint32_t)
4662 // CTS hardware flow control enable. If this bit is set to 1, CTS hardware flow control is enabled. Data is only transmitted when the nUARTCTS signal is asserted.
4663 ADD_BITFIELD_RW(CTSEN, 15, 1)
4664 // RTS hardware flow control enable. If this bit is set to 1, RTS hardware flow control is enabled. Data is only requested when there is space in the receive FIFO for it to be received.
4665 ADD_BITFIELD_RW(RTSEN, 14, 1)
4666 // This bit is the complement of the UART Out2 (nUARTOut2) modem status output. That is, when the bit is programmed to a 1, the output is 0. For DTE this can be used as Ring Indicator (RI).
4667 ADD_BITFIELD_RW(OUT2, 13, 1)
4668 // This bit is the complement of the UART Out1 (nUARTOut1) modem status output. That is, when the bit is programmed to a 1 the output is 0. For DTE this can be used as Data Carrier Detect (DCD).
4669 ADD_BITFIELD_RW(OUT1, 12, 1)
4670 // Request to send. This bit is the complement of the UART request to send, nUARTRTS, modem status output. That is, when the bit is programmed to a 1 then nUARTRTS is LOW.
4671 ADD_BITFIELD_RW(RTS, 11, 1)
4672 // Data transmit ready. This bit is the complement of the UART data transmit ready, nUARTDTR, modem status output. That is, when the bit is programmed to a 1 then nUARTDTR is LOW.
4673 ADD_BITFIELD_RW(DTR, 10, 1)
4674 // Receive enable. If this bit is set to 1, the receive section of the UART is enabled. Data reception occurs for either UART signals or SIR signals depending on the setting of the SIREN bit. When the UART is disabled in the middle of reception, it completes the current character before stopping.
4675 ADD_BITFIELD_RW(RXE, 9, 1)
4676 // Transmit enable. If this bit is set to 1, the transmit section of the UART is enabled. Data transmission occurs for either UART signals, or SIR signals depending on the setting of the SIREN bit. When the UART is disabled in the middle of transmission, it completes the current character before stopping.
4677 ADD_BITFIELD_RW(TXE, 8, 1)
4678 // Loopback enable. If this bit is set to 1 and the SIREN bit is set to 1 and the SIRTEST bit in the Test Control Register, UARTTCR is set to 1, then the nSIROUT path is inverted, and fed through to the SIRIN path. The SIRTEST bit in the test register must be set to 1 to override the normal half-duplex SIR operation. This must be the requirement for accessing the test registers during normal operation, and SIRTEST must be cleared to 0 when loopback testing is finished. This feature reduces the amount of external coupling required during system test. If this bit is set to 1, and the SIRTEST bit is set to 0, the UARTTXD path is fed through to the UARTRXD path. In either SIR mode or UART mode, when this bit is set, the modem outputs are also fed through to the modem inputs. This bit is cleared to 0 on reset, to disable loopback.
4679 ADD_BITFIELD_RW(LBE, 7, 1)
4680 // SIR low-power IrDA mode. This bit selects the IrDA encoding mode. If this bit is cleared to 0, low-level bits are transmitted as an active high pulse with a width of 3 / 16th of the bit period. If this bit is set to 1, low-level bits are transmitted with a pulse width that is 3 times the period of the IrLPBaud16 input signal, regardless of the selected bit rate. Setting this bit uses less power, but might reduce transmission distances.
4681 ADD_BITFIELD_RW(SIRLP, 2, 1)
4682 // SIR enable: 0 = IrDA SIR ENDEC is disabled. nSIROUT remains LOW (no light pulse generated), and signal transitions on SIRIN have no effect. 1 = IrDA SIR ENDEC is enabled. Data is transmitted and received on nSIROUT and SIRIN. UARTTXD remains HIGH, in the marking state. Signal transitions on UARTRXD or modem status inputs have no effect. This bit has no effect if the UARTEN bit disables the UART.
4683 ADD_BITFIELD_RW(SIREN, 1, 1)
4684 // UART enable: 0 = UART is disabled. If the UART is disabled in the middle of transmission or reception, it completes the current character before stopping. 1 = the UART is enabled. Data transmission and reception occurs for either UART signals or SIR signals depending on the setting of the SIREN bit.
4685 ADD_BITFIELD_RW(UARTEN, 0, 1)
4686 END_TYPE()
4687
4688 // Interrupt FIFO Level Select Register, UARTIFLS
4689 // Reset value: 0x00000012
4690 BEGIN_TYPE(UARTIFLS_t, uint32_t)
4691 // Receive interrupt FIFO level select. The trigger points for the receive interrupt are as follows: b000 = Receive FIFO becomes >= 1 / 8 full b001 = Receive FIFO becomes >= 1 / 4 full b010 = Receive FIFO becomes >= 1 / 2 full b011 = Receive FIFO becomes >= 3 / 4 full b100 = Receive FIFO becomes >= 7 / 8 full b101-b111 = reserved.
4692 ADD_BITFIELD_RW(RXIFLSEL, 3, 3)
4693 // Transmit interrupt FIFO level select. The trigger points for the transmit interrupt are as follows: b000 = Transmit FIFO becomes <= 1 / 8 full b001 = Transmit FIFO becomes <= 1 / 4 full b010 = Transmit FIFO becomes <= 1 / 2 full b011 = Transmit FIFO becomes <= 3 / 4 full b100 = Transmit FIFO becomes <= 7 / 8 full b101-b111 = reserved.
4694 ADD_BITFIELD_RW(TXIFLSEL, 0, 3)
4695 END_TYPE()
4696
4697 // Interrupt Mask Set/Clear Register, UARTIMSC
4698 // Reset value: 0x00000000
4699 BEGIN_TYPE(UARTIMSC_t, uint32_t)
4700 // Overrun error interrupt mask. A read returns the current mask for the UARTOEINTR interrupt. On a write of 1, the mask of the UARTOEINTR interrupt is set. A write of 0 clears the mask.
4701 ADD_BITFIELD_RW(OEIM, 10, 1)
4702 // Break error interrupt mask. A read returns the current mask for the UARTBEINTR interrupt. On a write of 1, the mask of the UARTBEINTR interrupt is set. A write of 0 clears the mask.
4703 ADD_BITFIELD_RW(BEIM, 9, 1)
4704 // Parity error interrupt mask. A read returns the current mask for the UARTPEINTR interrupt. On a write of 1, the mask of the UARTPEINTR interrupt is set. A write of 0 clears the mask.
4705 ADD_BITFIELD_RW(PEIM, 8, 1)
4706 // Framing error interrupt mask. A read returns the current mask for the UARTFEINTR interrupt. On a write of 1, the mask of the UARTFEINTR interrupt is set. A write of 0 clears the mask.
4707 ADD_BITFIELD_RW(FEIM, 7, 1)
4708 // Receive timeout interrupt mask. A read returns the current mask for the UARTRTINTR interrupt. On a write of 1, the mask of the UARTRTINTR interrupt is set. A write of 0 clears the mask.
4709 ADD_BITFIELD_RW(RTIM, 6, 1)
4710 // Transmit interrupt mask. A read returns the current mask for the UARTTXINTR interrupt. On a write of 1, the mask of the UARTTXINTR interrupt is set. A write of 0 clears the mask.
4711 ADD_BITFIELD_RW(TXIM, 5, 1)
4712 // Receive interrupt mask. A read returns the current mask for the UARTRXINTR interrupt. On a write of 1, the mask of the UARTRXINTR interrupt is set. A write of 0 clears the mask.
4713 ADD_BITFIELD_RW(RXIM, 4, 1)
4714 // nUARTDSR modem interrupt mask. A read returns the current mask for the UARTDSRINTR interrupt. On a write of 1, the mask of the UARTDSRINTR interrupt is set. A write of 0 clears the mask.
4715 ADD_BITFIELD_RW(DSRMIM, 3, 1)
4716 // nUARTDCD modem interrupt mask. A read returns the current mask for the UARTDCDINTR interrupt. On a write of 1, the mask of the UARTDCDINTR interrupt is set. A write of 0 clears the mask.
4717 ADD_BITFIELD_RW(DCDMIM, 2, 1)
4718 // nUARTCTS modem interrupt mask. A read returns the current mask for the UARTCTSINTR interrupt. On a write of 1, the mask of the UARTCTSINTR interrupt is set. A write of 0 clears the mask.
4719 ADD_BITFIELD_RW(CTSMIM, 1, 1)
4720 // nUARTRI modem interrupt mask. A read returns the current mask for the UARTRIINTR interrupt. On a write of 1, the mask of the UARTRIINTR interrupt is set. A write of 0 clears the mask.
4721 ADD_BITFIELD_RW(RIMIM, 0, 1)
4722 END_TYPE()
4723
4724 // Raw Interrupt Status Register, UARTRIS
4725 // Reset value: 0x00000000
4726 BEGIN_TYPE(UARTRIS_t, uint32_t)
4727 // Overrun error interrupt status. Returns the raw interrupt state of the UARTOEINTR interrupt.
4728 ADD_BITFIELD_RO(OERIS, 10, 1)
4729 // Break error interrupt status. Returns the raw interrupt state of the UARTBEINTR interrupt.
4730 ADD_BITFIELD_RO(BERIS, 9, 1)
4731 // Parity error interrupt status. Returns the raw interrupt state of the UARTPEINTR interrupt.
4732 ADD_BITFIELD_RO(PERIS, 8, 1)
4733 // Framing error interrupt status. Returns the raw interrupt state of the UARTFEINTR interrupt.
4734 ADD_BITFIELD_RO(FERIS, 7, 1)
4735 // Receive timeout interrupt status. Returns the raw interrupt state of the UARTRTINTR interrupt. a
4736 ADD_BITFIELD_RO(RTRIS, 6, 1)
4737 // Transmit interrupt status. Returns the raw interrupt state of the UARTTXINTR interrupt.
4738 ADD_BITFIELD_RO(TXRIS, 5, 1)
4739 // Receive interrupt status. Returns the raw interrupt state of the UARTRXINTR interrupt.
4740 ADD_BITFIELD_RO(RXRIS, 4, 1)
4741 // nUARTDSR modem interrupt status. Returns the raw interrupt state of the UARTDSRINTR interrupt.
4742 ADD_BITFIELD_RO(DSRRMIS, 3, 1)
4743 // nUARTDCD modem interrupt status. Returns the raw interrupt state of the UARTDCDINTR interrupt.
4744 ADD_BITFIELD_RO(DCDRMIS, 2, 1)
4745 // nUARTCTS modem interrupt status. Returns the raw interrupt state of the UARTCTSINTR interrupt.
4746 ADD_BITFIELD_RO(CTSRMIS, 1, 1)
4747 // nUARTRI modem interrupt status. Returns the raw interrupt state of the UARTRIINTR interrupt.
4748 ADD_BITFIELD_RO(RIRMIS, 0, 1)
4749 END_TYPE()
4750
4751 // Masked Interrupt Status Register, UARTMIS
4752 // Reset value: 0x00000000
4753 BEGIN_TYPE(UARTMIS_t, uint32_t)
4754 // Overrun error masked interrupt status. Returns the masked interrupt state of the UARTOEINTR interrupt.
4755 ADD_BITFIELD_RO(OEMIS, 10, 1)
4756 // Break error masked interrupt status. Returns the masked interrupt state of the UARTBEINTR interrupt.
4757 ADD_BITFIELD_RO(BEMIS, 9, 1)
4758 // Parity error masked interrupt status. Returns the masked interrupt state of the UARTPEINTR interrupt.
4759 ADD_BITFIELD_RO(PEMIS, 8, 1)
4760 // Framing error masked interrupt status. Returns the masked interrupt state of the UARTFEINTR interrupt.
4761 ADD_BITFIELD_RO(FEMIS, 7, 1)
4762 // Receive timeout masked interrupt status. Returns the masked interrupt state of the UARTRTINTR interrupt.
4763 ADD_BITFIELD_RO(RTMIS, 6, 1)
4764 // Transmit masked interrupt status. Returns the masked interrupt state of the UARTTXINTR interrupt.
4765 ADD_BITFIELD_RO(TXMIS, 5, 1)
4766 // Receive masked interrupt status. Returns the masked interrupt state of the UARTRXINTR interrupt.
4767 ADD_BITFIELD_RO(RXMIS, 4, 1)
4768 // nUARTDSR modem masked interrupt status. Returns the masked interrupt state of the UARTDSRINTR interrupt.
4769 ADD_BITFIELD_RO(DSRMMIS, 3, 1)
4770 // nUARTDCD modem masked interrupt status. Returns the masked interrupt state of the UARTDCDINTR interrupt.
4771 ADD_BITFIELD_RO(DCDMMIS, 2, 1)
4772 // nUARTCTS modem masked interrupt status. Returns the masked interrupt state of the UARTCTSINTR interrupt.
4773 ADD_BITFIELD_RO(CTSMMIS, 1, 1)
4774 // nUARTRI modem masked interrupt status. Returns the masked interrupt state of the UARTRIINTR interrupt.
4775 ADD_BITFIELD_RO(RIMMIS, 0, 1)
4776 END_TYPE()
4777
4778 // Interrupt Clear Register, UARTICR
4779 // Reset value: 0x00000000
4780 BEGIN_TYPE(UARTICR_t, uint32_t)
4781 // Overrun error interrupt clear. Clears the UARTOEINTR interrupt.
4782 ADD_BITFIELD_RW(OEIC, 10, 1)
4783 // Break error interrupt clear. Clears the UARTBEINTR interrupt.
4784 ADD_BITFIELD_RW(BEIC, 9, 1)
4785 // Parity error interrupt clear. Clears the UARTPEINTR interrupt.
4786 ADD_BITFIELD_RW(PEIC, 8, 1)
4787 // Framing error interrupt clear. Clears the UARTFEINTR interrupt.
4788 ADD_BITFIELD_RW(FEIC, 7, 1)
4789 // Receive timeout interrupt clear. Clears the UARTRTINTR interrupt.
4790 ADD_BITFIELD_RW(RTIC, 6, 1)
4791 // Transmit interrupt clear. Clears the UARTTXINTR interrupt.
4792 ADD_BITFIELD_RW(TXIC, 5, 1)
4793 // Receive interrupt clear. Clears the UARTRXINTR interrupt.
4794 ADD_BITFIELD_RW(RXIC, 4, 1)
4795 // nUARTDSR modem interrupt clear. Clears the UARTDSRINTR interrupt.
4796 ADD_BITFIELD_RW(DSRMIC, 3, 1)
4797 // nUARTDCD modem interrupt clear. Clears the UARTDCDINTR interrupt.
4798 ADD_BITFIELD_RW(DCDMIC, 2, 1)
4799 // nUARTCTS modem interrupt clear. Clears the UARTCTSINTR interrupt.
4800 ADD_BITFIELD_RW(CTSMIC, 1, 1)
4801 // nUARTRI modem interrupt clear. Clears the UARTRIINTR interrupt.
4802 ADD_BITFIELD_RW(RIMIC, 0, 1)
4803 END_TYPE()
4804
4805 // DMA Control Register, UARTDMACR
4806 // Reset value: 0x00000000
4807 BEGIN_TYPE(UARTDMACR_t, uint32_t)
4808 // DMA on error. If this bit is set to 1, the DMA receive request outputs, UARTRXDMASREQ or UARTRXDMABREQ, are disabled when the UART error interrupt is asserted.
4809 ADD_BITFIELD_RW(DMAONERR, 2, 1)
4810 // Transmit DMA enable. If this bit is set to 1, DMA for the transmit FIFO is enabled.
4811 ADD_BITFIELD_RW(TXDMAE, 1, 1)
4812 // Receive DMA enable. If this bit is set to 1, DMA for the receive FIFO is enabled.
4813 ADD_BITFIELD_RW(RXDMAE, 0, 1)
4814 END_TYPE()
4815
4816 // UARTPeriphID0 Register
4817 // Reset value: 0x00000011
4818 BEGIN_TYPE(UARTPERIPHID0_t, uint32_t)
4819 // These bits read back as 0x11
4820 ADD_BITFIELD_RO(PARTNUMBER0, 0, 8)
4821 END_TYPE()
4822
4823 // UARTPeriphID1 Register
4824 // Reset value: 0x00000010
4825 BEGIN_TYPE(UARTPERIPHID1_t, uint32_t)
4826 // These bits read back as 0x1
4827 ADD_BITFIELD_RO(DESIGNER0, 4, 4)
4828 // These bits read back as 0x0
4829 ADD_BITFIELD_RO(PARTNUMBER1, 0, 4)
4830 END_TYPE()
4831
4832 // UARTPeriphID2 Register
4833 // Reset value: 0x00000034
4834 BEGIN_TYPE(UARTPERIPHID2_t, uint32_t)
4835 // This field depends on the revision of the UART: r1p0 0x0 r1p1 0x1 r1p3 0x2 r1p4 0x2 r1p5 0x3
4836 ADD_BITFIELD_RO(REVISION, 4, 4)
4837 // These bits read back as 0x4
4838 ADD_BITFIELD_RO(DESIGNER1, 0, 4)
4839 END_TYPE()
4840
4841 // UARTPeriphID3 Register
4842 // Reset value: 0x00000000
4843 BEGIN_TYPE(UARTPERIPHID3_t, uint32_t)
4844 // These bits read back as 0x00
4845 ADD_BITFIELD_RO(CONFIGURATION, 0, 8)
4846 END_TYPE()
4847
4848 // UARTPCellID0 Register
4849 // Reset value: 0x0000000d
4850 BEGIN_TYPE(UARTPCELLID0_t, uint32_t)
4851 // These bits read back as 0x0D
4852 ADD_BITFIELD_RO(UARTPCELLID0, 0, 8)
4853 END_TYPE()
4854
4855 // UARTPCellID1 Register
4856 // Reset value: 0x000000f0
4857 BEGIN_TYPE(UARTPCELLID1_t, uint32_t)
4858 // These bits read back as 0xF0
4859 ADD_BITFIELD_RO(UARTPCELLID1, 0, 8)
4860 END_TYPE()
4861
4862 // UARTPCellID2 Register
4863 // Reset value: 0x00000005
4864 BEGIN_TYPE(UARTPCELLID2_t, uint32_t)
4865 // These bits read back as 0x05
4866 ADD_BITFIELD_RO(UARTPCELLID2, 0, 8)
4867 END_TYPE()
4868
4869 // UARTPCellID3 Register
4870 // Reset value: 0x000000b1
4871 BEGIN_TYPE(UARTPCELLID3_t, uint32_t)
4872 // These bits read back as 0xB1
4873 ADD_BITFIELD_RO(UARTPCELLID3, 0, 8)
4874 END_TYPE()
4875
4876 struct UART0_t {
4877 UARTDR_t UARTDR;
4878 UARTRSR_t UARTRSR;
4879 uint32_t reserved0[4];
4880 UARTFR_t UARTFR;
4881 uint32_t reserved1;
4882 UARTILPR_t UARTILPR;
4883 UARTIBRD_t UARTIBRD;
4884 UARTFBRD_t UARTFBRD;
4885 UARTLCR_H_t UARTLCR_H;
4886 UARTCR_t UARTCR;
4887 UARTIFLS_t UARTIFLS;
4888 UARTIMSC_t UARTIMSC;
4889 UARTRIS_t UARTRIS;
4890 UARTMIS_t UARTMIS;
4891 UARTICR_t UARTICR;
4892 UARTDMACR_t UARTDMACR;
4893 uint32_t reserved2[997];
4894 UARTPERIPHID0_t UARTPERIPHID0;
4895 UARTPERIPHID1_t UARTPERIPHID1;
4896 UARTPERIPHID2_t UARTPERIPHID2;
4897 UARTPERIPHID3_t UARTPERIPHID3;
4898 UARTPCELLID0_t UARTPCELLID0;
4899 UARTPCELLID1_t UARTPCELLID1;
4900 UARTPCELLID2_t UARTPCELLID2;
4901 UARTPCELLID3_t UARTPCELLID3;
4902 };
4903
4904 static UART0_t & UART0 = (*(UART0_t *)0x40034000);
4905 static UART0_t & UART0_XOR = (*(UART0_t *)0x40035000);
4906 static UART0_t & UART0_SET = (*(UART0_t *)0x40036000);
4907 static UART0_t & UART0_CLR = (*(UART0_t *)0x40037000);
4908
4909} // _UART0_
4910
4911namespace _UART1_ {
4912
4913 static _UART0_::UART0_t & UART1 = (*(_UART0_::UART0_t *)0x40038000);
4914 static _UART0_::UART0_t & UART1_XOR = (*(_UART0_::UART0_t *)0x40039000);
4915 static _UART0_::UART0_t & UART1_SET = (*(_UART0_::UART0_t *)0x4003a000);
4916 static _UART0_::UART0_t & UART1_CLR = (*(_UART0_::UART0_t *)0x4003b000);
4917
4918} // _UART1_
4919
4920namespace _SPI0_ {
4921
4922 // Control register 0, SSPCR0 on page 3-4
4923 // Reset value: 0x00000000
4924 BEGIN_TYPE(SSPCR0_t, uint32_t)
4925 // Serial clock rate. The value SCR is used to generate the transmit and receive bit rate of the PrimeCell SSP. The bit rate is: F SSPCLK CPSDVSR x (1+SCR) where CPSDVSR is an even value from 2-254, programmed through the SSPCPSR register and SCR is a value from 0-255.
4926 ADD_BITFIELD_RW(SCR, 8, 8)
4927 // SSPCLKOUT phase, applicable to Motorola SPI frame format only. See Motorola SPI frame format on page 2-10.
4928 ADD_BITFIELD_RW(SPH, 7, 1)
4929 // SSPCLKOUT polarity, applicable to Motorola SPI frame format only. See Motorola SPI frame format on page 2-10.
4930 ADD_BITFIELD_RW(SPO, 6, 1)
4931 // Frame format: 00 Motorola SPI frame format. 01 TI synchronous serial frame format. 10 National Microwire frame format. 11 Reserved, undefined operation.
4932 ADD_BITFIELD_RW(FRF, 4, 2)
4933 // Data Size Select: 0000 Reserved, undefined operation. 0001 Reserved, undefined operation. 0010 Reserved, undefined operation. 0011 4-bit data. 0100 5-bit data. 0101 6-bit data. 0110 7-bit data. 0111 8-bit data. 1000 9-bit data. 1001 10-bit data. 1010 11-bit data. 1011 12-bit data. 1100 13-bit data. 1101 14-bit data. 1110 15-bit data. 1111 16-bit data.
4934 ADD_BITFIELD_RW(DSS, 0, 4)
4935 END_TYPE()
4936
4937 // Control register 1, SSPCR1 on page 3-5
4938 // Reset value: 0x00000000
4939 BEGIN_TYPE(SSPCR1_t, uint32_t)
4940 // Slave-mode output disable. This bit is relevant only in the slave mode, MS=1. In multiple-slave systems, it is possible for an PrimeCell SSP master to broadcast a message to all slaves in the system while ensuring that only one slave drives data onto its serial output line. In such systems the RXD lines from multiple slaves could be tied together. To operate in such systems, the SOD bit can be set if the PrimeCell SSP slave is not supposed to drive the SSPTXD line: 0 SSP can drive the SSPTXD output in slave mode. 1 SSP must not drive the SSPTXD output in slave mode.
4941 ADD_BITFIELD_RW(SOD, 3, 1)
4942 // Master or slave mode select. This bit can be modified only when the PrimeCell SSP is disabled, SSE=0: 0 Device configured as master, default. 1 Device configured as slave.
4943 ADD_BITFIELD_RW(MS, 2, 1)
4944 // Synchronous serial port enable: 0 SSP operation disabled. 1 SSP operation enabled.
4945 ADD_BITFIELD_RW(SSE, 1, 1)
4946 // Loop back mode: 0 Normal serial port operation enabled. 1 Output of transmit serial shifter is connected to input of receive serial shifter internally.
4947 ADD_BITFIELD_RW(LBM, 0, 1)
4948 END_TYPE()
4949
4950 // Data register, SSPDR on page 3-6
4951 // Reset value: 0x00000000
4952 BEGIN_TYPE(SSPDR_t, uint32_t)
4953 // Transmit/Receive FIFO: Read Receive FIFO. Write Transmit FIFO. You must right-justify data when the PrimeCell SSP is programmed for a data size that is less than 16 bits. Unused bits at the top are ignored by transmit logic. The receive logic automatically right-justifies.
4954 ADD_BITFIELD_RW(DATA, 0, 16)
4955 END_TYPE()
4956
4957 // Status register, SSPSR on page 3-7
4958 // Reset value: 0x00000003
4959 BEGIN_TYPE(SSPSR_t, uint32_t)
4960 // PrimeCell SSP busy flag, RO: 0 SSP is idle. 1 SSP is currently transmitting and/or receiving a frame or the transmit FIFO is not empty.
4961 ADD_BITFIELD_RO(BSY, 4, 1)
4962 // Receive FIFO full, RO: 0 Receive FIFO is not full. 1 Receive FIFO is full.
4963 ADD_BITFIELD_RO(RFF, 3, 1)
4964 // Receive FIFO not empty, RO: 0 Receive FIFO is empty. 1 Receive FIFO is not empty.
4965 ADD_BITFIELD_RO(RNE, 2, 1)
4966 // Transmit FIFO not full, RO: 0 Transmit FIFO is full. 1 Transmit FIFO is not full.
4967 ADD_BITFIELD_RO(TNF, 1, 1)
4968 // Transmit FIFO empty, RO: 0 Transmit FIFO is not empty. 1 Transmit FIFO is empty.
4969 ADD_BITFIELD_RO(TFE, 0, 1)
4970 END_TYPE()
4971
4972 // Clock prescale register, SSPCPSR on page 3-8
4973 // Reset value: 0x00000000
4974 BEGIN_TYPE(SSPCPSR_t, uint32_t)
4975 // Clock prescale divisor. Must be an even number from 2-254, depending on the frequency of SSPCLK. The least significant bit always returns zero on reads.
4976 ADD_BITFIELD_RW(CPSDVSR, 0, 8)
4977 END_TYPE()
4978
4979 // Interrupt mask set or clear register, SSPIMSC on page 3-9
4980 // Reset value: 0x00000000
4981 BEGIN_TYPE(SSPIMSC_t, uint32_t)
4982 // Transmit FIFO interrupt mask: 0 Transmit FIFO half empty or less condition interrupt is masked. 1 Transmit FIFO half empty or less condition interrupt is not masked.
4983 ADD_BITFIELD_RW(TXIM, 3, 1)
4984 // Receive FIFO interrupt mask: 0 Receive FIFO half full or less condition interrupt is masked. 1 Receive FIFO half full or less condition interrupt is not masked.
4985 ADD_BITFIELD_RW(RXIM, 2, 1)
4986 // Receive timeout interrupt mask: 0 Receive FIFO not empty and no read prior to timeout period interrupt is masked. 1 Receive FIFO not empty and no read prior to timeout period interrupt is not masked.
4987 ADD_BITFIELD_RW(RTIM, 1, 1)
4988 // Receive overrun interrupt mask: 0 Receive FIFO written to while full condition interrupt is masked. 1 Receive FIFO written to while full condition interrupt is not masked.
4989 ADD_BITFIELD_RW(RORIM, 0, 1)
4990 END_TYPE()
4991
4992 // Raw interrupt status register, SSPRIS on page 3-10
4993 // Reset value: 0x00000008
4994 BEGIN_TYPE(SSPRIS_t, uint32_t)
4995 // Gives the raw interrupt state, prior to masking, of the SSPTXINTR interrupt
4996 ADD_BITFIELD_RO(TXRIS, 3, 1)
4997 // Gives the raw interrupt state, prior to masking, of the SSPRXINTR interrupt
4998 ADD_BITFIELD_RO(RXRIS, 2, 1)
4999 // Gives the raw interrupt state, prior to masking, of the SSPRTINTR interrupt
5000 ADD_BITFIELD_RO(RTRIS, 1, 1)
5001 // Gives the raw interrupt state, prior to masking, of the SSPRORINTR interrupt
5002 ADD_BITFIELD_RO(RORRIS, 0, 1)
5003 END_TYPE()
5004
5005 // Masked interrupt status register, SSPMIS on page 3-11
5006 // Reset value: 0x00000000
5007 BEGIN_TYPE(SSPMIS_t, uint32_t)
5008 // Gives the transmit FIFO masked interrupt state, after masking, of the SSPTXINTR interrupt
5009 ADD_BITFIELD_RO(TXMIS, 3, 1)
5010 // Gives the receive FIFO masked interrupt state, after masking, of the SSPRXINTR interrupt
5011 ADD_BITFIELD_RO(RXMIS, 2, 1)
5012 // Gives the receive timeout masked interrupt state, after masking, of the SSPRTINTR interrupt
5013 ADD_BITFIELD_RO(RTMIS, 1, 1)
5014 // Gives the receive over run masked interrupt status, after masking, of the SSPRORINTR interrupt
5015 ADD_BITFIELD_RO(RORMIS, 0, 1)
5016 END_TYPE()
5017
5018 // Interrupt clear register, SSPICR on page 3-11
5019 // Reset value: 0x00000000
5020 BEGIN_TYPE(SSPICR_t, uint32_t)
5021 // Clears the SSPRTINTR interrupt
5022 ADD_BITFIELD_RW(RTIC, 1, 1)
5023 // Clears the SSPRORINTR interrupt
5024 ADD_BITFIELD_RW(RORIC, 0, 1)
5025 END_TYPE()
5026
5027 // DMA control register, SSPDMACR on page 3-12
5028 // Reset value: 0x00000000
5029 BEGIN_TYPE(SSPDMACR_t, uint32_t)
5030 // Transmit DMA Enable. If this bit is set to 1, DMA for the transmit FIFO is enabled.
5031 ADD_BITFIELD_RW(TXDMAE, 1, 1)
5032 // Receive DMA Enable. If this bit is set to 1, DMA for the receive FIFO is enabled.
5033 ADD_BITFIELD_RW(RXDMAE, 0, 1)
5034 END_TYPE()
5035
5036 // Peripheral identification registers, SSPPeriphID0-3 on page 3-13
5037 // Reset value: 0x00000022
5038 BEGIN_TYPE(SSPPERIPHID0_t, uint32_t)
5039 // These bits read back as 0x22
5040 ADD_BITFIELD_RO(PARTNUMBER0, 0, 8)
5041 END_TYPE()
5042
5043 // Peripheral identification registers, SSPPeriphID0-3 on page 3-13
5044 // Reset value: 0x00000010
5045 BEGIN_TYPE(SSPPERIPHID1_t, uint32_t)
5046 // These bits read back as 0x1
5047 ADD_BITFIELD_RO(DESIGNER0, 4, 4)
5048 // These bits read back as 0x0
5049 ADD_BITFIELD_RO(PARTNUMBER1, 0, 4)
5050 END_TYPE()
5051
5052 // Peripheral identification registers, SSPPeriphID0-3 on page 3-13
5053 // Reset value: 0x00000034
5054 BEGIN_TYPE(SSPPERIPHID2_t, uint32_t)
5055 // These bits return the peripheral revision
5056 ADD_BITFIELD_RO(REVISION, 4, 4)
5057 // These bits read back as 0x4
5058 ADD_BITFIELD_RO(DESIGNER1, 0, 4)
5059 END_TYPE()
5060
5061 // Peripheral identification registers, SSPPeriphID0-3 on page 3-13
5062 // Reset value: 0x00000000
5063 BEGIN_TYPE(SSPPERIPHID3_t, uint32_t)
5064 // These bits read back as 0x00
5065 ADD_BITFIELD_RO(CONFIGURATION, 0, 8)
5066 END_TYPE()
5067
5068 // PrimeCell identification registers, SSPPCellID0-3 on page 3-16
5069 // Reset value: 0x0000000d
5070 BEGIN_TYPE(SSPPCELLID0_t, uint32_t)
5071 // These bits read back as 0x0D
5072 ADD_BITFIELD_RO(SSPPCELLID0, 0, 8)
5073 END_TYPE()
5074
5075 // PrimeCell identification registers, SSPPCellID0-3 on page 3-16
5076 // Reset value: 0x000000f0
5077 BEGIN_TYPE(SSPPCELLID1_t, uint32_t)
5078 // These bits read back as 0xF0
5079 ADD_BITFIELD_RO(SSPPCELLID1, 0, 8)
5080 END_TYPE()
5081
5082 // PrimeCell identification registers, SSPPCellID0-3 on page 3-16
5083 // Reset value: 0x00000005
5084 BEGIN_TYPE(SSPPCELLID2_t, uint32_t)
5085 // These bits read back as 0x05
5086 ADD_BITFIELD_RO(SSPPCELLID2, 0, 8)
5087 END_TYPE()
5088
5089 // PrimeCell identification registers, SSPPCellID0-3 on page 3-16
5090 // Reset value: 0x000000b1
5091 BEGIN_TYPE(SSPPCELLID3_t, uint32_t)
5092 // These bits read back as 0xB1
5093 ADD_BITFIELD_RO(SSPPCELLID3, 0, 8)
5094 END_TYPE()
5095
5096 struct SPI0_t {
5097 SSPCR0_t SSPCR0;
5098 SSPCR1_t SSPCR1;
5099 SSPDR_t SSPDR;
5100 SSPSR_t SSPSR;
5101 SSPCPSR_t SSPCPSR;
5102 SSPIMSC_t SSPIMSC;
5103 SSPRIS_t SSPRIS;
5104 SSPMIS_t SSPMIS;
5105 SSPICR_t SSPICR;
5106 SSPDMACR_t SSPDMACR;
5107 uint32_t reserved0[1006];
5108 SSPPERIPHID0_t SSPPERIPHID0;
5109 SSPPERIPHID1_t SSPPERIPHID1;
5110 SSPPERIPHID2_t SSPPERIPHID2;
5111 SSPPERIPHID3_t SSPPERIPHID3;
5112 SSPPCELLID0_t SSPPCELLID0;
5113 SSPPCELLID1_t SSPPCELLID1;
5114 SSPPCELLID2_t SSPPCELLID2;
5115 SSPPCELLID3_t SSPPCELLID3;
5116 };
5117
5118 static SPI0_t & SPI0 = (*(SPI0_t *)0x4003c000);
5119 static SPI0_t & SPI0_XOR = (*(SPI0_t *)0x4003d000);
5120 static SPI0_t & SPI0_SET = (*(SPI0_t *)0x4003e000);
5121 static SPI0_t & SPI0_CLR = (*(SPI0_t *)0x4003f000);
5122
5123} // _SPI0_
5124
5125namespace _SPI1_ {
5126
5127 static _SPI0_::SPI0_t & SPI1 = (*(_SPI0_::SPI0_t *)0x40040000);
5128 static _SPI0_::SPI0_t & SPI1_XOR = (*(_SPI0_::SPI0_t *)0x40041000);
5129 static _SPI0_::SPI0_t & SPI1_SET = (*(_SPI0_::SPI0_t *)0x40042000);
5130 static _SPI0_::SPI0_t & SPI1_CLR = (*(_SPI0_::SPI0_t *)0x40043000);
5131
5132} // _SPI1_
5133
5134// DW_apb_i2c address block
5135//
5136// List of configuration constants for the Synopsys I2C hardware (you may see references to these in I2C register header; these are *fixed* values, set at hardware design time):
5137//
5138// IC_ULTRA_FAST_MODE ................ 0x0
5139// IC_UFM_TBUF_CNT_DEFAULT ........... 0x8
5140// IC_UFM_SCL_LOW_COUNT .............. 0x0008
5141// IC_UFM_SCL_HIGH_COUNT ............. 0x0006
5142// IC_TX_TL .......................... 0x0
5143// IC_TX_CMD_BLOCK ................... 0x1
5144// IC_HAS_DMA ........................ 0x1
5145// IC_HAS_ASYNC_FIFO ................. 0x0
5146// IC_SMBUS_ARP ...................... 0x0
5147// IC_FIRST_DATA_BYTE_STATUS ......... 0x1
5148// IC_INTR_IO ........................ 0x1
5149// IC_MASTER_MODE .................... 0x1
5150// IC_DEFAULT_ACK_GENERAL_CALL ....... 0x1
5151// IC_INTR_POL ....................... 0x1
5152// IC_OPTIONAL_SAR ................... 0x0
5153// IC_DEFAULT_TAR_SLAVE_ADDR ......... 0x055
5154// IC_DEFAULT_SLAVE_ADDR ............. 0x055
5155// IC_DEFAULT_HS_SPKLEN .............. 0x1
5156// IC_FS_SCL_HIGH_COUNT .............. 0x0006
5157// IC_HS_SCL_LOW_COUNT ............... 0x0008
5158// IC_DEVICE_ID_VALUE ................ 0x0
5159// IC_10BITADDR_MASTER ............... 0x0
5160// IC_CLK_FREQ_OPTIMIZATION .......... 0x0
5161// IC_DEFAULT_FS_SPKLEN .............. 0x7
5162// IC_ADD_ENCODED_PARAMS ............. 0x0
5163// IC_DEFAULT_SDA_HOLD ............... 0x000001
5164// IC_DEFAULT_SDA_SETUP .............. 0x64
5165// IC_AVOID_RX_FIFO_FLUSH_ON_TX_ABRT . 0x0
5166// IC_CLOCK_PERIOD ................... 100
5167// IC_EMPTYFIFO_HOLD_MASTER_EN ....... 1
5168// IC_RESTART_EN ..................... 0x1
5169// IC_TX_CMD_BLOCK_DEFAULT ........... 0x0
5170// IC_BUS_CLEAR_FEATURE .............. 0x0
5171// IC_CAP_LOADING .................... 100
5172// IC_FS_SCL_LOW_COUNT ............... 0x000d
5173// APB_DATA_WIDTH .................... 32
5174// IC_SDA_STUCK_TIMEOUT_DEFAULT ...... 0xffffffff
5175// IC_SLV_DATA_NACK_ONLY ............. 0x1
5176// IC_10BITADDR_SLAVE ................ 0x0
5177// IC_CLK_TYPE ....................... 0x0
5178// IC_SMBUS_UDID_MSB ................. 0x0
5179// IC_SMBUS_SUSPEND_ALERT ............ 0x0
5180// IC_HS_SCL_HIGH_COUNT .............. 0x0006
5181// IC_SLV_RESTART_DET_EN ............. 0x1
5182// IC_SMBUS .......................... 0x0
5183// IC_OPTIONAL_SAR_DEFAULT ........... 0x0
5184// IC_PERSISTANT_SLV_ADDR_DEFAULT .... 0x0
5185// IC_USE_COUNTS ..................... 0x0
5186// IC_RX_BUFFER_DEPTH ................ 16
5187// IC_SCL_STUCK_TIMEOUT_DEFAULT ...... 0xffffffff
5188// IC_RX_FULL_HLD_BUS_EN ............. 0x1
5189// IC_SLAVE_DISABLE .................. 0x1
5190// IC_RX_TL .......................... 0x0
5191// IC_DEVICE_ID ...................... 0x0
5192// IC_HC_COUNT_VALUES ................ 0x0
5193// I2C_DYNAMIC_TAR_UPDATE ............ 0
5194// IC_SMBUS_CLK_LOW_MEXT_DEFAULT ..... 0xffffffff
5195// IC_SMBUS_CLK_LOW_SEXT_DEFAULT ..... 0xffffffff
5196// IC_HS_MASTER_CODE ................. 0x1
5197// IC_SMBUS_RST_IDLE_CNT_DEFAULT ..... 0xffff
5198// IC_SMBUS_UDID_LSB_DEFAULT ......... 0xffffffff
5199// IC_SS_SCL_HIGH_COUNT .............. 0x0028
5200// IC_SS_SCL_LOW_COUNT ............... 0x002f
5201// IC_MAX_SPEED_MODE ................. 0x2
5202// IC_STAT_FOR_CLK_STRETCH ........... 0x0
5203// IC_STOP_DET_IF_MASTER_ACTIVE ...... 0x0
5204// IC_DEFAULT_UFM_SPKLEN ............. 0x1
5205// IC_TX_BUFFER_DEPTH ................ 16
5206namespace _I2C0_ {
5207
5208 // I2C Control Register. This register can be written only when the DW_apb_i2c is disabled, which corresponds to the IC_ENABLE[0] register being set to 0. Writes at other times have no effect.
5209 //
5210 // Read/Write Access: - bit 10 is read only. - bit 11 is read only - bit 16 is read only - bit 17 is read only - bits 18 and 19 are read only.
5211 // Reset value: 0x00000065
5212 BEGIN_TYPE(IC_CON_t, uint32_t)
5213 // Master issues the STOP_DET interrupt irrespective of whether master is active or not
5214 ADD_BITFIELD_RO(STOP_DET_IF_MASTER_ACTIVE, 10, 1)
5215 // This bit controls whether DW_apb_i2c should hold the bus when the Rx FIFO is physically full to its RX_BUFFER_DEPTH, as described in the IC_RX_FULL_HLD_BUS_EN parameter.
5216 //
5217 // Reset value: 0x0.
5218 ADD_BITFIELD_RW(RX_FIFO_FULL_HLD_CTRL, 9, 1)
5219 // This bit controls the generation of the TX_EMPTY interrupt, as described in the IC_RAW_INTR_STAT register.
5220 //
5221 // Reset value: 0x0.
5222 ADD_BITFIELD_RW(TX_EMPTY_CTRL, 8, 1)
5223 // In slave mode: - 1'b1: issues the STOP_DET interrupt only when it is addressed. - 1'b0: issues the STOP_DET irrespective of whether it's addressed or not. Reset value: 0x0
5224 //
5225 // NOTE: During a general call address, this slave does not issue the STOP_DET interrupt if STOP_DET_IF_ADDRESSED = 1'b1, even if the slave responds to the general call address by generating ACK. The STOP_DET interrupt is generated only when the transmitted address matches the slave address (SAR).
5226 ADD_BITFIELD_RW(STOP_DET_IFADDRESSED, 7, 1)
5227 // This bit controls whether I2C has its slave disabled, which means once the presetn signal is applied, then this bit is set and the slave is disabled.
5228 //
5229 // If this bit is set (slave is disabled), DW_apb_i2c functions only as a master and does not perform any action that requires a slave.
5230 //
5231 // NOTE: Software should ensure that if this bit is written with 0, then bit 0 should also be written with a 0.
5232 ADD_BITFIELD_RW(IC_SLAVE_DISABLE, 6, 1)
5233 // Determines whether RESTART conditions may be sent when acting as a master. Some older slaves do not support handling RESTART conditions; however, RESTART conditions are used in several DW_apb_i2c operations. When RESTART is disabled, the master is prohibited from performing the following functions: - Sending a START BYTE - Performing any high-speed mode operation - High-speed mode operation - Performing direction changes in combined format mode - Performing a read operation with a 10-bit address By replacing RESTART condition followed by a STOP and a subsequent START condition, split operations are broken down into multiple DW_apb_i2c transfers. If the above operations are performed, it will result in setting bit 6 (TX_ABRT) of the IC_RAW_INTR_STAT register.
5234 //
5235 // Reset value: ENABLED
5236 ADD_BITFIELD_RW(IC_RESTART_EN, 5, 1)
5237 // Controls whether the DW_apb_i2c starts its transfers in 7- or 10-bit addressing mode when acting as a master. - 0: 7-bit addressing - 1: 10-bit addressing
5238 ADD_BITFIELD_RW(IC_10BITADDR_MASTER, 4, 1)
5239 // When acting as a slave, this bit controls whether the DW_apb_i2c responds to 7- or 10-bit addresses. - 0: 7-bit addressing. The DW_apb_i2c ignores transactions that involve 10-bit addressing; for 7-bit addressing, only the lower 7 bits of the IC_SAR register are compared. - 1: 10-bit addressing. The DW_apb_i2c responds to only 10-bit addressing transfers that match the full 10 bits of the IC_SAR register.
5240 ADD_BITFIELD_RW(IC_10BITADDR_SLAVE, 3, 1)
5241 // These bits control at which speed the DW_apb_i2c operates; its setting is relevant only if one is operating the DW_apb_i2c in master mode. Hardware protects against illegal values being programmed by software. These bits must be programmed appropriately for slave mode also, as it is used to capture correct value of spike filter as per the speed mode.
5242 //
5243 // This register should be programmed only with a value in the range of 1 to IC_MAX_SPEED_MODE; otherwise, hardware updates this register with the value of IC_MAX_SPEED_MODE.
5244 //
5245 // 1: standard mode (100 kbit/s)
5246 //
5247 // 2: fast mode (<=400 kbit/s) or fast mode plus (<=1000Kbit/s)
5248 //
5249 // 3: high speed mode (3.4 Mbit/s)
5250 //
5251 // Note: This field is not applicable when IC_ULTRA_FAST_MODE=1
5252 ADD_BITFIELD_RW(SPEED, 1, 2)
5253 // This bit controls whether the DW_apb_i2c master is enabled.
5254 //
5255 // NOTE: Software should ensure that if this bit is written with '1' then bit 6 should also be written with a '1'.
5256 ADD_BITFIELD_RW(MASTER_MODE, 0, 1)
5257 END_TYPE()
5258
5259 // Overflow when RX_FIFO is full
5260 static const uint32_t IC_CON_RX_FIFO_FULL_HLD_CTRL__DISABLED = 0;
5261 // Hold bus when RX_FIFO is full
5262 static const uint32_t IC_CON_RX_FIFO_FULL_HLD_CTRL__ENABLED = 1;
5263 // Default behaviour of TX_EMPTY interrupt
5264 static const uint32_t IC_CON_TX_EMPTY_CTRL__DISABLED = 0;
5265 // Controlled generation of TX_EMPTY interrupt
5266 static const uint32_t IC_CON_TX_EMPTY_CTRL__ENABLED = 1;
5267 // slave issues STOP_DET intr always
5268 static const uint32_t IC_CON_STOP_DET_IFADDRESSED__DISABLED = 0;
5269 // slave issues STOP_DET intr only if addressed
5270 static const uint32_t IC_CON_STOP_DET_IFADDRESSED__ENABLED = 1;
5271 // Slave mode is enabled
5272 static const uint32_t IC_CON_IC_SLAVE_DISABLE__SLAVE_ENABLED = 0;
5273 // Slave mode is disabled
5274 static const uint32_t IC_CON_IC_SLAVE_DISABLE__SLAVE_DISABLED = 1;
5275 // Master restart disabled
5276 static const uint32_t IC_CON_IC_RESTART_EN__DISABLED = 0;
5277 // Master restart enabled
5278 static const uint32_t IC_CON_IC_RESTART_EN__ENABLED = 1;
5279 // Master 7Bit addressing mode
5280 static const uint32_t IC_CON_IC_10BITADDR_MASTER__ADDR_7BITS = 0;
5281 // Master 10Bit addressing mode
5282 static const uint32_t IC_CON_IC_10BITADDR_MASTER__ADDR_10BITS = 1;
5283 // Slave 7Bit addressing
5284 static const uint32_t IC_CON_IC_10BITADDR_SLAVE__ADDR_7BITS = 0;
5285 // Slave 10Bit addressing
5286 static const uint32_t IC_CON_IC_10BITADDR_SLAVE__ADDR_10BITS = 1;
5287 // Standard Speed mode of operation
5288 static const uint32_t IC_CON_SPEED__STANDARD = 1;
5289 // Fast or Fast Plus mode of operation
5290 static const uint32_t IC_CON_SPEED__FAST = 2;
5291 // High Speed mode of operation
5292 static const uint32_t IC_CON_SPEED__HIGH = 3;
5293 // Master mode is disabled
5294 static const uint32_t IC_CON_MASTER_MODE__DISABLED = 0;
5295 // Master mode is enabled
5296 static const uint32_t IC_CON_MASTER_MODE__ENABLED = 1;
5297
5298 // I2C Target Address Register
5299 //
5300 // This register is 12 bits wide, and bits 31:12 are reserved. This register can be written to only when IC_ENABLE[0] is set to 0.
5301 //
5302 // Note: If the software or application is aware that the DW_apb_i2c is not using the TAR address for the pending commands in the Tx FIFO, then it is possible to update the TAR address even while the Tx FIFO has entries (IC_STATUS[2]= 0). - It is not necessary to perform any write to this register if DW_apb_i2c is enabled as an I2C slave only.
5303 // Reset value: 0x00000055
5304 BEGIN_TYPE(IC_TAR_t, uint32_t)
5305 // This bit indicates whether software performs a Device-ID or General Call or START BYTE command. - 0: ignore bit 10 GC_OR_START and use IC_TAR normally - 1: perform special I2C command as specified in Device_ID or GC_OR_START bit Reset value: 0x0
5306 ADD_BITFIELD_RW(SPECIAL, 11, 1)
5307 // If bit 11 (SPECIAL) is set to 1 and bit 13(Device-ID) is set to 0, then this bit indicates whether a General Call or START byte command is to be performed by the DW_apb_i2c. - 0: General Call Address - after issuing a General Call, only writes may be performed. Attempting to issue a read command results in setting bit 6 (TX_ABRT) of the IC_RAW_INTR_STAT register. The DW_apb_i2c remains in General Call mode until the SPECIAL bit value (bit 11) is cleared. - 1: START BYTE Reset value: 0x0
5308 ADD_BITFIELD_RW(GC_OR_START, 10, 1)
5309 // This is the target address for any master transaction. When transmitting a General Call, these bits are ignored. To generate a START BYTE, the CPU needs to write only once into these bits.
5310 //
5311 // If the IC_TAR and IC_SAR are the same, loopback exists but the FIFOs are shared between master and slave, so full loopback is not feasible. Only one direction loopback mode is supported (simplex), not duplex. A master cannot transmit to itself; it can transmit to only a slave.
5312 ADD_BITFIELD_RW(IC_TAR, 0, 10)
5313 END_TYPE()
5314
5315 // Disables programming of GENERAL_CALL or START_BYTE transmission
5316 static const uint32_t IC_TAR_SPECIAL__DISABLED = 0;
5317 // Enables programming of GENERAL_CALL or START_BYTE transmission
5318 static const uint32_t IC_TAR_SPECIAL__ENABLED = 1;
5319 // GENERAL_CALL byte transmission
5320 static const uint32_t IC_TAR_GC_OR_START__GENERAL_CALL = 0;
5321 // START byte transmission
5322 static const uint32_t IC_TAR_GC_OR_START__START_BYTE = 1;
5323
5324 // I2C Slave Address Register
5325 // Reset value: 0x00000055
5326 BEGIN_TYPE(IC_SAR_t, uint32_t)
5327 // The IC_SAR holds the slave address when the I2C is operating as a slave. For 7-bit addressing, only IC_SAR[6:0] is used.
5328 //
5329 // This register can be written only when the I2C interface is disabled, which corresponds to the IC_ENABLE[0] register being set to 0. Writes at other times have no effect.
5330 //
5331 // Note: The default values cannot be any of the reserved address locations: that is, 0x00 to 0x07, or 0x78 to 0x7f. The correct operation of the device is not guaranteed if you program the IC_SAR or IC_TAR to a reserved value. Refer to <<table_I2C_firstbyte_bit_defs>> for a complete list of these reserved values.
5332 ADD_BITFIELD_RW(IC_SAR, 0, 10)
5333 END_TYPE()
5334
5335 // I2C Rx/Tx Data Buffer and Command Register; this is the register the CPU writes to when filling the TX FIFO and the CPU reads from when retrieving bytes from RX FIFO.
5336 //
5337 // The size of the register changes as follows:
5338 //
5339 // Write: - 11 bits when IC_EMPTYFIFO_HOLD_MASTER_EN=1 - 9 bits when IC_EMPTYFIFO_HOLD_MASTER_EN=0 Read: - 12 bits when IC_FIRST_DATA_BYTE_STATUS = 1 - 8 bits when IC_FIRST_DATA_BYTE_STATUS = 0 Note: In order for the DW_apb_i2c to continue acknowledging reads, a read command should be written for every byte that is to be received; otherwise the DW_apb_i2c will stop acknowledging.
5340 // Reset value: 0x00000000
5341 BEGIN_TYPE(IC_DATA_CMD_t, uint32_t)
5342 // Indicates the first data byte received after the address phase for receive transfer in Master receiver or Slave receiver mode.
5343 //
5344 // Reset value : 0x0
5345 //
5346 // NOTE: In case of APB_DATA_WIDTH=8,
5347 //
5348 // 1. The user has to perform two APB Reads to IC_DATA_CMD in order to get status on 11 bit.
5349 //
5350 // 2. In order to read the 11 bit, the user has to perform the first data byte read [7:0] (offset 0x10) and then perform the second read [15:8] (offset 0x11) in order to know the status of 11 bit (whether the data received in previous read is a first data byte or not).
5351 //
5352 // 3. The 11th bit is an optional read field, user can ignore 2nd byte read [15:8] (offset 0x11) if not interested in FIRST_DATA_BYTE status.
5353 ADD_BITFIELD_RO(FIRST_DATA_BYTE, 11, 1)
5354 // This bit controls whether a RESTART is issued before the byte is sent or received.
5355 //
5356 // 1 - If IC_RESTART_EN is 1, a RESTART is issued before the data is sent/received (according to the value of CMD), regardless of whether or not the transfer direction is changing from the previous command; if IC_RESTART_EN is 0, a STOP followed by a START is issued instead.
5357 //
5358 // 0 - If IC_RESTART_EN is 1, a RESTART is issued only if the transfer direction is changing from the previous command; if IC_RESTART_EN is 0, a STOP followed by a START is issued instead.
5359 //
5360 // Reset value: 0x0
5361 ADD_BITFIELD_RW(RESTART, 10, 1)
5362 // This bit controls whether a STOP is issued after the byte is sent or received.
5363 //
5364 // - 1 - STOP is issued after this byte, regardless of whether or not the Tx FIFO is empty. If the Tx FIFO is not empty, the master immediately tries to start a new transfer by issuing a START and arbitrating for the bus. - 0 - STOP is not issued after this byte, regardless of whether or not the Tx FIFO is empty. If the Tx FIFO is not empty, the master continues the current transfer by sending/receiving data bytes according to the value of the CMD bit. If the Tx FIFO is empty, the master holds the SCL line low and stalls the bus until a new command is available in the Tx FIFO. Reset value: 0x0
5365 ADD_BITFIELD_RW(STOP, 9, 1)
5366 // This bit controls whether a read or a write is performed. This bit does not control the direction when the DW_apb_i2con acts as a slave. It controls only the direction when it acts as a master.
5367 //
5368 // When a command is entered in the TX FIFO, this bit distinguishes the write and read commands. In slave-receiver mode, this bit is a 'don't care' because writes to this register are not required. In slave-transmitter mode, a '0' indicates that the data in IC_DATA_CMD is to be transmitted.
5369 //
5370 // When programming this bit, you should remember the following: attempting to perform a read operation after a General Call command has been sent results in a TX_ABRT interrupt (bit 6 of the IC_RAW_INTR_STAT register), unless bit 11 (SPECIAL) in the IC_TAR register has been cleared. If a '1' is written to this bit after receiving a RD_REQ interrupt, then a TX_ABRT interrupt occurs.
5371 //
5372 // Reset value: 0x0
5373 ADD_BITFIELD_RW(CMD, 8, 1)
5374 // This register contains the data to be transmitted or received on the I2C bus. If you are writing to this register and want to perform a read, bits 7:0 (DAT) are ignored by the DW_apb_i2c. However, when you read this register, these bits return the value of data received on the DW_apb_i2c interface.
5375 //
5376 // Reset value: 0x0
5377 ADD_BITFIELD_RW(DAT, 0, 8)
5378 END_TYPE()
5379
5380 // Sequential data byte received
5381 static const uint32_t IC_DATA_CMD_FIRST_DATA_BYTE__INACTIVE = 0;
5382 // Non sequential data byte received
5383 static const uint32_t IC_DATA_CMD_FIRST_DATA_BYTE__ACTIVE = 1;
5384 // Don't Issue RESTART before this command
5385 static const uint32_t IC_DATA_CMD_RESTART__DISABLE = 0;
5386 // Issue RESTART before this command
5387 static const uint32_t IC_DATA_CMD_RESTART__ENABLE = 1;
5388 // Don't Issue STOP after this command
5389 static const uint32_t IC_DATA_CMD_STOP__DISABLE = 0;
5390 // Issue STOP after this command
5391 static const uint32_t IC_DATA_CMD_STOP__ENABLE = 1;
5392 // Master Write Command
5393 static const uint32_t IC_DATA_CMD_CMD__WRITE = 0;
5394 // Master Read Command
5395 static const uint32_t IC_DATA_CMD_CMD__READ = 1;
5396
5397 // Standard Speed I2C Clock SCL High Count Register
5398 // Reset value: 0x00000028
5399 BEGIN_TYPE(IC_SS_SCL_HCNT_t, uint32_t)
5400 // This register must be set before any I2C bus transaction can take place to ensure proper I/O timing. This register sets the SCL clock high-period count for standard speed. For more information, refer to 'IC_CLK Frequency Configuration'.
5401 //
5402 // This register can be written only when the I2C interface is disabled which corresponds to the IC_ENABLE[0] register being set to 0. Writes at other times have no effect.
5403 //
5404 // The minimum valid value is 6; hardware prevents values less than this being written, and if attempted results in 6 being set. For designs with APB_DATA_WIDTH = 8, the order of programming is important to ensure the correct operation of the DW_apb_i2c. The lower byte must be programmed first. Then the upper byte is programmed.
5405 //
5406 // NOTE: This register must not be programmed to a value higher than 65525, because DW_apb_i2c uses a 16-bit counter to flag an I2C bus idle condition when this counter reaches a value of IC_SS_SCL_HCNT + 10.
5407 ADD_BITFIELD_RW(IC_SS_SCL_HCNT, 0, 16)
5408 END_TYPE()
5409
5410 // Standard Speed I2C Clock SCL Low Count Register
5411 // Reset value: 0x0000002f
5412 BEGIN_TYPE(IC_SS_SCL_LCNT_t, uint32_t)
5413 // This register must be set before any I2C bus transaction can take place to ensure proper I/O timing. This register sets the SCL clock low period count for standard speed. For more information, refer to 'IC_CLK Frequency Configuration'
5414 //
5415 // This register can be written only when the I2C interface is disabled which corresponds to the IC_ENABLE[0] register being set to 0. Writes at other times have no effect.
5416 //
5417 // The minimum valid value is 8; hardware prevents values less than this being written, and if attempted, results in 8 being set. For designs with APB_DATA_WIDTH = 8, the order of programming is important to ensure the correct operation of DW_apb_i2c. The lower byte must be programmed first, and then the upper byte is programmed.
5418 ADD_BITFIELD_RW(IC_SS_SCL_LCNT, 0, 16)
5419 END_TYPE()
5420
5421 // Fast Mode or Fast Mode Plus I2C Clock SCL High Count Register
5422 // Reset value: 0x00000006
5423 BEGIN_TYPE(IC_FS_SCL_HCNT_t, uint32_t)
5424 // This register must be set before any I2C bus transaction can take place to ensure proper I/O timing. This register sets the SCL clock high-period count for fast mode or fast mode plus. It is used in high-speed mode to send the Master Code and START BYTE or General CALL. For more information, refer to 'IC_CLK Frequency Configuration'.
5425 //
5426 // This register goes away and becomes read-only returning 0s if IC_MAX_SPEED_MODE = standard. This register can be written only when the I2C interface is disabled, which corresponds to the IC_ENABLE[0] register being set to 0. Writes at other times have no effect.
5427 //
5428 // The minimum valid value is 6; hardware prevents values less than this being written, and if attempted results in 6 being set. For designs with APB_DATA_WIDTH == 8 the order of programming is important to ensure the correct operation of the DW_apb_i2c. The lower byte must be programmed first. Then the upper byte is programmed.
5429 ADD_BITFIELD_RW(IC_FS_SCL_HCNT, 0, 16)
5430 END_TYPE()
5431
5432 // Fast Mode or Fast Mode Plus I2C Clock SCL Low Count Register
5433 // Reset value: 0x0000000d
5434 BEGIN_TYPE(IC_FS_SCL_LCNT_t, uint32_t)
5435 // This register must be set before any I2C bus transaction can take place to ensure proper I/O timing. This register sets the SCL clock low period count for fast speed. It is used in high-speed mode to send the Master Code and START BYTE or General CALL. For more information, refer to 'IC_CLK Frequency Configuration'.
5436 //
5437 // This register goes away and becomes read-only returning 0s if IC_MAX_SPEED_MODE = standard.
5438 //
5439 // This register can be written only when the I2C interface is disabled, which corresponds to the IC_ENABLE[0] register being set to 0. Writes at other times have no effect.
5440 //
5441 // The minimum valid value is 8; hardware prevents values less than this being written, and if attempted results in 8 being set. For designs with APB_DATA_WIDTH = 8 the order of programming is important to ensure the correct operation of the DW_apb_i2c. The lower byte must be programmed first. Then the upper byte is programmed. If the value is less than 8 then the count value gets changed to 8.
5442 ADD_BITFIELD_RW(IC_FS_SCL_LCNT, 0, 16)
5443 END_TYPE()
5444
5445 // I2C Interrupt Status Register
5446 //
5447 // Each bit in this register has a corresponding mask bit in the IC_INTR_MASK register. These bits are cleared by reading the matching interrupt clear register. The unmasked raw versions of these bits are available in the IC_RAW_INTR_STAT register.
5448 // Reset value: 0x00000000
5449 BEGIN_TYPE(IC_INTR_STAT_t, uint32_t)
5450 // See IC_RAW_INTR_STAT for a detailed description of R_RESTART_DET bit.
5451 //
5452 // Reset value: 0x0
5453 ADD_BITFIELD_RO(R_RESTART_DET, 12, 1)
5454 // See IC_RAW_INTR_STAT for a detailed description of R_GEN_CALL bit.
5455 //
5456 // Reset value: 0x0
5457 ADD_BITFIELD_RO(R_GEN_CALL, 11, 1)
5458 // See IC_RAW_INTR_STAT for a detailed description of R_START_DET bit.
5459 //
5460 // Reset value: 0x0
5461 ADD_BITFIELD_RO(R_START_DET, 10, 1)
5462 // See IC_RAW_INTR_STAT for a detailed description of R_STOP_DET bit.
5463 //
5464 // Reset value: 0x0
5465 ADD_BITFIELD_RO(R_STOP_DET, 9, 1)
5466 // See IC_RAW_INTR_STAT for a detailed description of R_ACTIVITY bit.
5467 //
5468 // Reset value: 0x0
5469 ADD_BITFIELD_RO(R_ACTIVITY, 8, 1)
5470 // See IC_RAW_INTR_STAT for a detailed description of R_RX_DONE bit.
5471 //
5472 // Reset value: 0x0
5473 ADD_BITFIELD_RO(R_RX_DONE, 7, 1)
5474 // See IC_RAW_INTR_STAT for a detailed description of R_TX_ABRT bit.
5475 //
5476 // Reset value: 0x0
5477 ADD_BITFIELD_RO(R_TX_ABRT, 6, 1)
5478 // See IC_RAW_INTR_STAT for a detailed description of R_RD_REQ bit.
5479 //
5480 // Reset value: 0x0
5481 ADD_BITFIELD_RO(R_RD_REQ, 5, 1)
5482 // See IC_RAW_INTR_STAT for a detailed description of R_TX_EMPTY bit.
5483 //
5484 // Reset value: 0x0
5485 ADD_BITFIELD_RO(R_TX_EMPTY, 4, 1)
5486 // See IC_RAW_INTR_STAT for a detailed description of R_TX_OVER bit.
5487 //
5488 // Reset value: 0x0
5489 ADD_BITFIELD_RO(R_TX_OVER, 3, 1)
5490 // See IC_RAW_INTR_STAT for a detailed description of R_RX_FULL bit.
5491 //
5492 // Reset value: 0x0
5493 ADD_BITFIELD_RO(R_RX_FULL, 2, 1)
5494 // See IC_RAW_INTR_STAT for a detailed description of R_RX_OVER bit.
5495 //
5496 // Reset value: 0x0
5497 ADD_BITFIELD_RO(R_RX_OVER, 1, 1)
5498 // See IC_RAW_INTR_STAT for a detailed description of R_RX_UNDER bit.
5499 //
5500 // Reset value: 0x0
5501 ADD_BITFIELD_RO(R_RX_UNDER, 0, 1)
5502 END_TYPE()
5503
5504 // R_RESTART_DET interrupt is inactive
5505 static const uint32_t IC_INTR_STAT_R_RESTART_DET__INACTIVE = 0;
5506 // R_RESTART_DET interrupt is active
5507 static const uint32_t IC_INTR_STAT_R_RESTART_DET__ACTIVE = 1;
5508 // R_GEN_CALL interrupt is inactive
5509 static const uint32_t IC_INTR_STAT_R_GEN_CALL__INACTIVE = 0;
5510 // R_GEN_CALL interrupt is active
5511 static const uint32_t IC_INTR_STAT_R_GEN_CALL__ACTIVE = 1;
5512 // R_START_DET interrupt is inactive
5513 static const uint32_t IC_INTR_STAT_R_START_DET__INACTIVE = 0;
5514 // R_START_DET interrupt is active
5515 static const uint32_t IC_INTR_STAT_R_START_DET__ACTIVE = 1;
5516 // R_STOP_DET interrupt is inactive
5517 static const uint32_t IC_INTR_STAT_R_STOP_DET__INACTIVE = 0;
5518 // R_STOP_DET interrupt is active
5519 static const uint32_t IC_INTR_STAT_R_STOP_DET__ACTIVE = 1;
5520 // R_ACTIVITY interrupt is inactive
5521 static const uint32_t IC_INTR_STAT_R_ACTIVITY__INACTIVE = 0;
5522 // R_ACTIVITY interrupt is active
5523 static const uint32_t IC_INTR_STAT_R_ACTIVITY__ACTIVE = 1;
5524 // R_RX_DONE interrupt is inactive
5525 static const uint32_t IC_INTR_STAT_R_RX_DONE__INACTIVE = 0;
5526 // R_RX_DONE interrupt is active
5527 static const uint32_t IC_INTR_STAT_R_RX_DONE__ACTIVE = 1;
5528 // R_TX_ABRT interrupt is inactive
5529 static const uint32_t IC_INTR_STAT_R_TX_ABRT__INACTIVE = 0;
5530 // R_TX_ABRT interrupt is active
5531 static const uint32_t IC_INTR_STAT_R_TX_ABRT__ACTIVE = 1;
5532 // R_RD_REQ interrupt is inactive
5533 static const uint32_t IC_INTR_STAT_R_RD_REQ__INACTIVE = 0;
5534 // R_RD_REQ interrupt is active
5535 static const uint32_t IC_INTR_STAT_R_RD_REQ__ACTIVE = 1;
5536 // R_TX_EMPTY interrupt is inactive
5537 static const uint32_t IC_INTR_STAT_R_TX_EMPTY__INACTIVE = 0;
5538 // R_TX_EMPTY interrupt is active
5539 static const uint32_t IC_INTR_STAT_R_TX_EMPTY__ACTIVE = 1;
5540 // R_TX_OVER interrupt is inactive
5541 static const uint32_t IC_INTR_STAT_R_TX_OVER__INACTIVE = 0;
5542 // R_TX_OVER interrupt is active
5543 static const uint32_t IC_INTR_STAT_R_TX_OVER__ACTIVE = 1;
5544 // R_RX_FULL interrupt is inactive
5545 static const uint32_t IC_INTR_STAT_R_RX_FULL__INACTIVE = 0;
5546 // R_RX_FULL interrupt is active
5547 static const uint32_t IC_INTR_STAT_R_RX_FULL__ACTIVE = 1;
5548 // R_RX_OVER interrupt is inactive
5549 static const uint32_t IC_INTR_STAT_R_RX_OVER__INACTIVE = 0;
5550 // R_RX_OVER interrupt is active
5551 static const uint32_t IC_INTR_STAT_R_RX_OVER__ACTIVE = 1;
5552 // RX_UNDER interrupt is inactive
5553 static const uint32_t IC_INTR_STAT_R_RX_UNDER__INACTIVE = 0;
5554 // RX_UNDER interrupt is active
5555 static const uint32_t IC_INTR_STAT_R_RX_UNDER__ACTIVE = 1;
5556
5557 // I2C Interrupt Mask Register.
5558 //
5559 // These bits mask their corresponding interrupt status bits. This register is active low; a value of 0 masks the interrupt, whereas a value of 1 unmasks the interrupt.
5560 // Reset value: 0x000008ff
5561 BEGIN_TYPE(IC_INTR_MASK_t, uint32_t)
5562 // This bit masks the R_RESTART_DET interrupt in IC_INTR_STAT register.
5563 //
5564 // Reset value: 0x0
5565 ADD_BITFIELD_RW(M_RESTART_DET, 12, 1)
5566 // This bit masks the R_GEN_CALL interrupt in IC_INTR_STAT register.
5567 //
5568 // Reset value: 0x1
5569 ADD_BITFIELD_RW(M_GEN_CALL, 11, 1)
5570 // This bit masks the R_START_DET interrupt in IC_INTR_STAT register.
5571 //
5572 // Reset value: 0x0
5573 ADD_BITFIELD_RW(M_START_DET, 10, 1)
5574 // This bit masks the R_STOP_DET interrupt in IC_INTR_STAT register.
5575 //
5576 // Reset value: 0x0
5577 ADD_BITFIELD_RW(M_STOP_DET, 9, 1)
5578 // This bit masks the R_ACTIVITY interrupt in IC_INTR_STAT register.
5579 //
5580 // Reset value: 0x0
5581 ADD_BITFIELD_RW(M_ACTIVITY, 8, 1)
5582 // This bit masks the R_RX_DONE interrupt in IC_INTR_STAT register.
5583 //
5584 // Reset value: 0x1
5585 ADD_BITFIELD_RW(M_RX_DONE, 7, 1)
5586 // This bit masks the R_TX_ABRT interrupt in IC_INTR_STAT register.
5587 //
5588 // Reset value: 0x1
5589 ADD_BITFIELD_RW(M_TX_ABRT, 6, 1)
5590 // This bit masks the R_RD_REQ interrupt in IC_INTR_STAT register.
5591 //
5592 // Reset value: 0x1
5593 ADD_BITFIELD_RW(M_RD_REQ, 5, 1)
5594 // This bit masks the R_TX_EMPTY interrupt in IC_INTR_STAT register.
5595 //
5596 // Reset value: 0x1
5597 ADD_BITFIELD_RW(M_TX_EMPTY, 4, 1)
5598 // This bit masks the R_TX_OVER interrupt in IC_INTR_STAT register.
5599 //
5600 // Reset value: 0x1
5601 ADD_BITFIELD_RW(M_TX_OVER, 3, 1)
5602 // This bit masks the R_RX_FULL interrupt in IC_INTR_STAT register.
5603 //
5604 // Reset value: 0x1
5605 ADD_BITFIELD_RW(M_RX_FULL, 2, 1)
5606 // This bit masks the R_RX_OVER interrupt in IC_INTR_STAT register.
5607 //
5608 // Reset value: 0x1
5609 ADD_BITFIELD_RW(M_RX_OVER, 1, 1)
5610 // This bit masks the R_RX_UNDER interrupt in IC_INTR_STAT register.
5611 //
5612 // Reset value: 0x1
5613 ADD_BITFIELD_RW(M_RX_UNDER, 0, 1)
5614 END_TYPE()
5615
5616 // RESTART_DET interrupt is masked
5617 static const uint32_t IC_INTR_MASK_M_RESTART_DET__ENABLED = 0;
5618 // RESTART_DET interrupt is unmasked
5619 static const uint32_t IC_INTR_MASK_M_RESTART_DET__DISABLED = 1;
5620 // GEN_CALL interrupt is masked
5621 static const uint32_t IC_INTR_MASK_M_GEN_CALL__ENABLED = 0;
5622 // GEN_CALL interrupt is unmasked
5623 static const uint32_t IC_INTR_MASK_M_GEN_CALL__DISABLED = 1;
5624 // START_DET interrupt is masked
5625 static const uint32_t IC_INTR_MASK_M_START_DET__ENABLED = 0;
5626 // START_DET interrupt is unmasked
5627 static const uint32_t IC_INTR_MASK_M_START_DET__DISABLED = 1;
5628 // STOP_DET interrupt is masked
5629 static const uint32_t IC_INTR_MASK_M_STOP_DET__ENABLED = 0;
5630 // STOP_DET interrupt is unmasked
5631 static const uint32_t IC_INTR_MASK_M_STOP_DET__DISABLED = 1;
5632 // ACTIVITY interrupt is masked
5633 static const uint32_t IC_INTR_MASK_M_ACTIVITY__ENABLED = 0;
5634 // ACTIVITY interrupt is unmasked
5635 static const uint32_t IC_INTR_MASK_M_ACTIVITY__DISABLED = 1;
5636 // RX_DONE interrupt is masked
5637 static const uint32_t IC_INTR_MASK_M_RX_DONE__ENABLED = 0;
5638 // RX_DONE interrupt is unmasked
5639 static const uint32_t IC_INTR_MASK_M_RX_DONE__DISABLED = 1;
5640 // TX_ABORT interrupt is masked
5641 static const uint32_t IC_INTR_MASK_M_TX_ABRT__ENABLED = 0;
5642 // TX_ABORT interrupt is unmasked
5643 static const uint32_t IC_INTR_MASK_M_TX_ABRT__DISABLED = 1;
5644 // RD_REQ interrupt is masked
5645 static const uint32_t IC_INTR_MASK_M_RD_REQ__ENABLED = 0;
5646 // RD_REQ interrupt is unmasked
5647 static const uint32_t IC_INTR_MASK_M_RD_REQ__DISABLED = 1;
5648 // TX_EMPTY interrupt is masked
5649 static const uint32_t IC_INTR_MASK_M_TX_EMPTY__ENABLED = 0;
5650 // TX_EMPTY interrupt is unmasked
5651 static const uint32_t IC_INTR_MASK_M_TX_EMPTY__DISABLED = 1;
5652 // TX_OVER interrupt is masked
5653 static const uint32_t IC_INTR_MASK_M_TX_OVER__ENABLED = 0;
5654 // TX_OVER interrupt is unmasked
5655 static const uint32_t IC_INTR_MASK_M_TX_OVER__DISABLED = 1;
5656 // RX_FULL interrupt is masked
5657 static const uint32_t IC_INTR_MASK_M_RX_FULL__ENABLED = 0;
5658 // RX_FULL interrupt is unmasked
5659 static const uint32_t IC_INTR_MASK_M_RX_FULL__DISABLED = 1;
5660 // RX_OVER interrupt is masked
5661 static const uint32_t IC_INTR_MASK_M_RX_OVER__ENABLED = 0;
5662 // RX_OVER interrupt is unmasked
5663 static const uint32_t IC_INTR_MASK_M_RX_OVER__DISABLED = 1;
5664 // RX_UNDER interrupt is masked
5665 static const uint32_t IC_INTR_MASK_M_RX_UNDER__ENABLED = 0;
5666 // RX_UNDER interrupt is unmasked
5667 static const uint32_t IC_INTR_MASK_M_RX_UNDER__DISABLED = 1;
5668
5669 // I2C Raw Interrupt Status Register
5670 //
5671 // Unlike the IC_INTR_STAT register, these bits are not masked so they always show the true status of the DW_apb_i2c.
5672 // Reset value: 0x00000000
5673 BEGIN_TYPE(IC_RAW_INTR_STAT_t, uint32_t)
5674 // Indicates whether a RESTART condition has occurred on the I2C interface when DW_apb_i2c is operating in Slave mode and the slave is being addressed. Enabled only when IC_SLV_RESTART_DET_EN=1.
5675 //
5676 // Note: However, in high-speed mode or during a START BYTE transfer, the RESTART comes before the address field as per the I2C protocol. In this case, the slave is not the addressed slave when the RESTART is issued, therefore DW_apb_i2c does not generate the RESTART_DET interrupt.
5677 //
5678 // Reset value: 0x0
5679 ADD_BITFIELD_RO(RESTART_DET, 12, 1)
5680 // Set only when a General Call address is received and it is acknowledged. It stays set until it is cleared either by disabling DW_apb_i2c or when the CPU reads bit 0 of the IC_CLR_GEN_CALL register. DW_apb_i2c stores the received data in the Rx buffer.
5681 //
5682 // Reset value: 0x0
5683 ADD_BITFIELD_RO(GEN_CALL, 11, 1)
5684 // Indicates whether a START or RESTART condition has occurred on the I2C interface regardless of whether DW_apb_i2c is operating in slave or master mode.
5685 //
5686 // Reset value: 0x0
5687 ADD_BITFIELD_RO(START_DET, 10, 1)
5688 // Indicates whether a STOP condition has occurred on the I2C interface regardless of whether DW_apb_i2c is operating in slave or master mode.
5689 //
5690 // In Slave Mode: - If IC_CON[7]=1'b1 (STOP_DET_IFADDRESSED), the STOP_DET interrupt will be issued only if slave is addressed. Note: During a general call address, this slave does not issue a STOP_DET interrupt if STOP_DET_IF_ADDRESSED=1'b1, even if the slave responds to the general call address by generating ACK. The STOP_DET interrupt is generated only when the transmitted address matches the slave address (SAR). - If IC_CON[7]=1'b0 (STOP_DET_IFADDRESSED), the STOP_DET interrupt is issued irrespective of whether it is being addressed. In Master Mode: - If IC_CON[10]=1'b1 (STOP_DET_IF_MASTER_ACTIVE),the STOP_DET interrupt will be issued only if Master is active. - If IC_CON[10]=1'b0 (STOP_DET_IFADDRESSED),the STOP_DET interrupt will be issued irrespective of whether master is active or not. Reset value: 0x0
5691 ADD_BITFIELD_RO(STOP_DET, 9, 1)
5692 // This bit captures DW_apb_i2c activity and stays set until it is cleared. There are four ways to clear it: - Disabling the DW_apb_i2c - Reading the IC_CLR_ACTIVITY register - Reading the IC_CLR_INTR register - System reset Once this bit is set, it stays set unless one of the four methods is used to clear it. Even if the DW_apb_i2c module is idle, this bit remains set until cleared, indicating that there was activity on the bus.
5693 //
5694 // Reset value: 0x0
5695 ADD_BITFIELD_RO(ACTIVITY, 8, 1)
5696 // When the DW_apb_i2c is acting as a slave-transmitter, this bit is set to 1 if the master does not acknowledge a transmitted byte. This occurs on the last byte of the transmission, indicating that the transmission is done.
5697 //
5698 // Reset value: 0x0
5699 ADD_BITFIELD_RO(RX_DONE, 7, 1)
5700 // This bit indicates if DW_apb_i2c, as an I2C transmitter, is unable to complete the intended actions on the contents of the transmit FIFO. This situation can occur both as an I2C master or an I2C slave, and is referred to as a 'transmit abort'. When this bit is set to 1, the IC_TX_ABRT_SOURCE register indicates the reason why the transmit abort takes places.
5701 //
5702 // Note: The DW_apb_i2c flushes/resets/empties the TX_FIFO and RX_FIFO whenever there is a transmit abort caused by any of the events tracked by the IC_TX_ABRT_SOURCE register. The FIFOs remains in this flushed state until the register IC_CLR_TX_ABRT is read. Once this read is performed, the Tx FIFO is then ready to accept more data bytes from the APB interface.
5703 //
5704 // Reset value: 0x0
5705 ADD_BITFIELD_RO(TX_ABRT, 6, 1)
5706 // This bit is set to 1 when DW_apb_i2c is acting as a slave and another I2C master is attempting to read data from DW_apb_i2c. The DW_apb_i2c holds the I2C bus in a wait state (SCL=0) until this interrupt is serviced, which means that the slave has been addressed by a remote master that is asking for data to be transferred. The processor must respond to this interrupt and then write the requested data to the IC_DATA_CMD register. This bit is set to 0 just after the processor reads the IC_CLR_RD_REQ register.
5707 //
5708 // Reset value: 0x0
5709 ADD_BITFIELD_RO(RD_REQ, 5, 1)
5710 // The behavior of the TX_EMPTY interrupt status differs based on the TX_EMPTY_CTRL selection in the IC_CON register. - When TX_EMPTY_CTRL = 0: This bit is set to 1 when the transmit buffer is at or below the threshold value set in the IC_TX_TL register. - When TX_EMPTY_CTRL = 1: This bit is set to 1 when the transmit buffer is at or below the threshold value set in the IC_TX_TL register and the transmission of the address/data from the internal shift register for the most recently popped command is completed. It is automatically cleared by hardware when the buffer level goes above the threshold. When IC_ENABLE[0] is set to 0, the TX FIFO is flushed and held in reset. There the TX FIFO looks like it has no data within it, so this bit is set to 1, provided there is activity in the master or slave state machines. When there is no longer any activity, then with ic_en=0, this bit is set to 0.
5711 //
5712 // Reset value: 0x0.
5713 ADD_BITFIELD_RO(TX_EMPTY, 4, 1)
5714 // Set during transmit if the transmit buffer is filled to IC_TX_BUFFER_DEPTH and the processor attempts to issue another I2C command by writing to the IC_DATA_CMD register. When the module is disabled, this bit keeps its level until the master or slave state machines go into idle, and when ic_en goes to 0, this interrupt is cleared.
5715 //
5716 // Reset value: 0x0
5717 ADD_BITFIELD_RO(TX_OVER, 3, 1)
5718 // Set when the receive buffer reaches or goes above the RX_TL threshold in the IC_RX_TL register. It is automatically cleared by hardware when buffer level goes below the threshold. If the module is disabled (IC_ENABLE[0]=0), the RX FIFO is flushed and held in reset; therefore the RX FIFO is not full. So this bit is cleared once the IC_ENABLE bit 0 is programmed with a 0, regardless of the activity that continues.
5719 //
5720 // Reset value: 0x0
5721 ADD_BITFIELD_RO(RX_FULL, 2, 1)
5722 // Set if the receive buffer is completely filled to IC_RX_BUFFER_DEPTH and an additional byte is received from an external I2C device. The DW_apb_i2c acknowledges this, but any data bytes received after the FIFO is full are lost. If the module is disabled (IC_ENABLE[0]=0), this bit keeps its level until the master or slave state machines go into idle, and when ic_en goes to 0, this interrupt is cleared.
5723 //
5724 // Note: If bit 9 of the IC_CON register (RX_FIFO_FULL_HLD_CTRL) is programmed to HIGH, then the RX_OVER interrupt never occurs, because the Rx FIFO never overflows.
5725 //
5726 // Reset value: 0x0
5727 ADD_BITFIELD_RO(RX_OVER, 1, 1)
5728 // Set if the processor attempts to read the receive buffer when it is empty by reading from the IC_DATA_CMD register. If the module is disabled (IC_ENABLE[0]=0), this bit keeps its level until the master or slave state machines go into idle, and when ic_en goes to 0, this interrupt is cleared.
5729 //
5730 // Reset value: 0x0
5731 ADD_BITFIELD_RO(RX_UNDER, 0, 1)
5732 END_TYPE()
5733
5734 // RESTART_DET interrupt is inactive
5735 static const uint32_t IC_RAW_INTR_STAT_RESTART_DET__INACTIVE = 0;
5736 // RESTART_DET interrupt is active
5737 static const uint32_t IC_RAW_INTR_STAT_RESTART_DET__ACTIVE = 1;
5738 // GEN_CALL interrupt is inactive
5739 static const uint32_t IC_RAW_INTR_STAT_GEN_CALL__INACTIVE = 0;
5740 // GEN_CALL interrupt is active
5741 static const uint32_t IC_RAW_INTR_STAT_GEN_CALL__ACTIVE = 1;
5742 // START_DET interrupt is inactive
5743 static const uint32_t IC_RAW_INTR_STAT_START_DET__INACTIVE = 0;
5744 // START_DET interrupt is active
5745 static const uint32_t IC_RAW_INTR_STAT_START_DET__ACTIVE = 1;
5746 // STOP_DET interrupt is inactive
5747 static const uint32_t IC_RAW_INTR_STAT_STOP_DET__INACTIVE = 0;
5748 // STOP_DET interrupt is active
5749 static const uint32_t IC_RAW_INTR_STAT_STOP_DET__ACTIVE = 1;
5750 // RAW_INTR_ACTIVITY interrupt is inactive
5751 static const uint32_t IC_RAW_INTR_STAT_ACTIVITY__INACTIVE = 0;
5752 // RAW_INTR_ACTIVITY interrupt is active
5753 static const uint32_t IC_RAW_INTR_STAT_ACTIVITY__ACTIVE = 1;
5754 // RX_DONE interrupt is inactive
5755 static const uint32_t IC_RAW_INTR_STAT_RX_DONE__INACTIVE = 0;
5756 // RX_DONE interrupt is active
5757 static const uint32_t IC_RAW_INTR_STAT_RX_DONE__ACTIVE = 1;
5758 // TX_ABRT interrupt is inactive
5759 static const uint32_t IC_RAW_INTR_STAT_TX_ABRT__INACTIVE = 0;
5760 // TX_ABRT interrupt is active
5761 static const uint32_t IC_RAW_INTR_STAT_TX_ABRT__ACTIVE = 1;
5762 // RD_REQ interrupt is inactive
5763 static const uint32_t IC_RAW_INTR_STAT_RD_REQ__INACTIVE = 0;
5764 // RD_REQ interrupt is active
5765 static const uint32_t IC_RAW_INTR_STAT_RD_REQ__ACTIVE = 1;
5766 // TX_EMPTY interrupt is inactive
5767 static const uint32_t IC_RAW_INTR_STAT_TX_EMPTY__INACTIVE = 0;
5768 // TX_EMPTY interrupt is active
5769 static const uint32_t IC_RAW_INTR_STAT_TX_EMPTY__ACTIVE = 1;
5770 // TX_OVER interrupt is inactive
5771 static const uint32_t IC_RAW_INTR_STAT_TX_OVER__INACTIVE = 0;
5772 // TX_OVER interrupt is active
5773 static const uint32_t IC_RAW_INTR_STAT_TX_OVER__ACTIVE = 1;
5774 // RX_FULL interrupt is inactive
5775 static const uint32_t IC_RAW_INTR_STAT_RX_FULL__INACTIVE = 0;
5776 // RX_FULL interrupt is active
5777 static const uint32_t IC_RAW_INTR_STAT_RX_FULL__ACTIVE = 1;
5778 // RX_OVER interrupt is inactive
5779 static const uint32_t IC_RAW_INTR_STAT_RX_OVER__INACTIVE = 0;
5780 // RX_OVER interrupt is active
5781 static const uint32_t IC_RAW_INTR_STAT_RX_OVER__ACTIVE = 1;
5782 // RX_UNDER interrupt is inactive
5783 static const uint32_t IC_RAW_INTR_STAT_RX_UNDER__INACTIVE = 0;
5784 // RX_UNDER interrupt is active
5785 static const uint32_t IC_RAW_INTR_STAT_RX_UNDER__ACTIVE = 1;
5786
5787 // I2C Receive FIFO Threshold Register
5788 // Reset value: 0x00000000
5789 BEGIN_TYPE(IC_RX_TL_t, uint32_t)
5790 // Receive FIFO Threshold Level.
5791 //
5792 // Controls the level of entries (or above) that triggers the RX_FULL interrupt (bit 2 in IC_RAW_INTR_STAT register). The valid range is 0-255, with the additional restriction that hardware does not allow this value to be set to a value larger than the depth of the buffer. If an attempt is made to do that, the actual value set will be the maximum depth of the buffer. A value of 0 sets the threshold for 1 entry, and a value of 255 sets the threshold for 256 entries.
5793 ADD_BITFIELD_RW(RX_TL, 0, 8)
5794 END_TYPE()
5795
5796 // I2C Transmit FIFO Threshold Register
5797 // Reset value: 0x00000000
5798 BEGIN_TYPE(IC_TX_TL_t, uint32_t)
5799 // Transmit FIFO Threshold Level.
5800 //
5801 // Controls the level of entries (or below) that trigger the TX_EMPTY interrupt (bit 4 in IC_RAW_INTR_STAT register). The valid range is 0-255, with the additional restriction that it may not be set to value larger than the depth of the buffer. If an attempt is made to do that, the actual value set will be the maximum depth of the buffer. A value of 0 sets the threshold for 0 entries, and a value of 255 sets the threshold for 255 entries.
5802 ADD_BITFIELD_RW(TX_TL, 0, 8)
5803 END_TYPE()
5804
5805 // Clear Combined and Individual Interrupt Register
5806 // Reset value: 0x00000000
5807 BEGIN_TYPE(IC_CLR_INTR_t, uint32_t)
5808 // Read this register to clear the combined interrupt, all individual interrupts, and the IC_TX_ABRT_SOURCE register. This bit does not clear hardware clearable interrupts but software clearable interrupts. Refer to Bit 9 of the IC_TX_ABRT_SOURCE register for an exception to clearing IC_TX_ABRT_SOURCE.
5809 //
5810 // Reset value: 0x0
5811 ADD_BITFIELD_RO(CLR_INTR, 0, 1)
5812 END_TYPE()
5813
5814 // Clear RX_UNDER Interrupt Register
5815 // Reset value: 0x00000000
5816 BEGIN_TYPE(IC_CLR_RX_UNDER_t, uint32_t)
5817 // Read this register to clear the RX_UNDER interrupt (bit 0) of the IC_RAW_INTR_STAT register.
5818 //
5819 // Reset value: 0x0
5820 ADD_BITFIELD_RO(CLR_RX_UNDER, 0, 1)
5821 END_TYPE()
5822
5823 // Clear RX_OVER Interrupt Register
5824 // Reset value: 0x00000000
5825 BEGIN_TYPE(IC_CLR_RX_OVER_t, uint32_t)
5826 // Read this register to clear the RX_OVER interrupt (bit 1) of the IC_RAW_INTR_STAT register.
5827 //
5828 // Reset value: 0x0
5829 ADD_BITFIELD_RO(CLR_RX_OVER, 0, 1)
5830 END_TYPE()
5831
5832 // Clear TX_OVER Interrupt Register
5833 // Reset value: 0x00000000
5834 BEGIN_TYPE(IC_CLR_TX_OVER_t, uint32_t)
5835 // Read this register to clear the TX_OVER interrupt (bit 3) of the IC_RAW_INTR_STAT register.
5836 //
5837 // Reset value: 0x0
5838 ADD_BITFIELD_RO(CLR_TX_OVER, 0, 1)
5839 END_TYPE()
5840
5841 // Clear RD_REQ Interrupt Register
5842 // Reset value: 0x00000000
5843 BEGIN_TYPE(IC_CLR_RD_REQ_t, uint32_t)
5844 // Read this register to clear the RD_REQ interrupt (bit 5) of the IC_RAW_INTR_STAT register.
5845 //
5846 // Reset value: 0x0
5847 ADD_BITFIELD_RO(CLR_RD_REQ, 0, 1)
5848 END_TYPE()
5849
5850 // Clear TX_ABRT Interrupt Register
5851 // Reset value: 0x00000000
5852 BEGIN_TYPE(IC_CLR_TX_ABRT_t, uint32_t)
5853 // Read this register to clear the TX_ABRT interrupt (bit 6) of the IC_RAW_INTR_STAT register, and the IC_TX_ABRT_SOURCE register. This also releases the TX FIFO from the flushed/reset state, allowing more writes to the TX FIFO. Refer to Bit 9 of the IC_TX_ABRT_SOURCE register for an exception to clearing IC_TX_ABRT_SOURCE.
5854 //
5855 // Reset value: 0x0
5856 ADD_BITFIELD_RO(CLR_TX_ABRT, 0, 1)
5857 END_TYPE()
5858
5859 // Clear RX_DONE Interrupt Register
5860 // Reset value: 0x00000000
5861 BEGIN_TYPE(IC_CLR_RX_DONE_t, uint32_t)
5862 // Read this register to clear the RX_DONE interrupt (bit 7) of the IC_RAW_INTR_STAT register.
5863 //
5864 // Reset value: 0x0
5865 ADD_BITFIELD_RO(CLR_RX_DONE, 0, 1)
5866 END_TYPE()
5867
5868 // Clear ACTIVITY Interrupt Register
5869 // Reset value: 0x00000000
5870 BEGIN_TYPE(IC_CLR_ACTIVITY_t, uint32_t)
5871 // Reading this register clears the ACTIVITY interrupt if the I2C is not active anymore. If the I2C module is still active on the bus, the ACTIVITY interrupt bit continues to be set. It is automatically cleared by hardware if the module is disabled and if there is no further activity on the bus. The value read from this register to get status of the ACTIVITY interrupt (bit 8) of the IC_RAW_INTR_STAT register.
5872 //
5873 // Reset value: 0x0
5874 ADD_BITFIELD_RO(CLR_ACTIVITY, 0, 1)
5875 END_TYPE()
5876
5877 // Clear STOP_DET Interrupt Register
5878 // Reset value: 0x00000000
5879 BEGIN_TYPE(IC_CLR_STOP_DET_t, uint32_t)
5880 // Read this register to clear the STOP_DET interrupt (bit 9) of the IC_RAW_INTR_STAT register.
5881 //
5882 // Reset value: 0x0
5883 ADD_BITFIELD_RO(CLR_STOP_DET, 0, 1)
5884 END_TYPE()
5885
5886 // Clear START_DET Interrupt Register
5887 // Reset value: 0x00000000
5888 BEGIN_TYPE(IC_CLR_START_DET_t, uint32_t)
5889 // Read this register to clear the START_DET interrupt (bit 10) of the IC_RAW_INTR_STAT register.
5890 //
5891 // Reset value: 0x0
5892 ADD_BITFIELD_RO(CLR_START_DET, 0, 1)
5893 END_TYPE()
5894
5895 // Clear GEN_CALL Interrupt Register
5896 // Reset value: 0x00000000
5897 BEGIN_TYPE(IC_CLR_GEN_CALL_t, uint32_t)
5898 // Read this register to clear the GEN_CALL interrupt (bit 11) of IC_RAW_INTR_STAT register.
5899 //
5900 // Reset value: 0x0
5901 ADD_BITFIELD_RO(CLR_GEN_CALL, 0, 1)
5902 END_TYPE()
5903
5904 // I2C Enable Register
5905 // Reset value: 0x00000000
5906 BEGIN_TYPE(IC_ENABLE_t, uint32_t)
5907 // In Master mode: - 1'b1: Blocks the transmission of data on I2C bus even if Tx FIFO has data to transmit. - 1'b0: The transmission of data starts on I2C bus automatically, as soon as the first data is available in the Tx FIFO. Note: To block the execution of Master commands, set the TX_CMD_BLOCK bit only when Tx FIFO is empty (IC_STATUS[2]==1) and Master is in Idle state (IC_STATUS[5] == 0). Any further commands put in the Tx FIFO are not executed until TX_CMD_BLOCK bit is unset. Reset value: IC_TX_CMD_BLOCK_DEFAULT
5908 ADD_BITFIELD_RW(TX_CMD_BLOCK, 2, 1)
5909 // When set, the controller initiates the transfer abort. - 0: ABORT not initiated or ABORT done - 1: ABORT operation in progress The software can abort the I2C transfer in master mode by setting this bit. The software can set this bit only when ENABLE is already set; otherwise, the controller ignores any write to ABORT bit. The software cannot clear the ABORT bit once set. In response to an ABORT, the controller issues a STOP and flushes the Tx FIFO after completing the current transfer, then sets the TX_ABORT interrupt after the abort operation. The ABORT bit is cleared automatically after the abort operation.
5910 //
5911 // For a detailed description on how to abort I2C transfers, refer to 'Aborting I2C Transfers'.
5912 //
5913 // Reset value: 0x0
5914 ADD_BITFIELD_RW(ABORT, 1, 1)
5915 // Controls whether the DW_apb_i2c is enabled. - 0: Disables DW_apb_i2c (TX and RX FIFOs are held in an erased state) - 1: Enables DW_apb_i2c Software can disable DW_apb_i2c while it is active. However, it is important that care be taken to ensure that DW_apb_i2c is disabled properly. A recommended procedure is described in 'Disabling DW_apb_i2c'.
5916 //
5917 // When DW_apb_i2c is disabled, the following occurs: - The TX FIFO and RX FIFO get flushed. - Status bits in the IC_INTR_STAT register are still active until DW_apb_i2c goes into IDLE state. If the module is transmitting, it stops as well as deletes the contents of the transmit buffer after the current transfer is complete. If the module is receiving, the DW_apb_i2c stops the current transfer at the end of the current byte and does not acknowledge the transfer.
5918 //
5919 // In systems with asynchronous pclk and ic_clk when IC_CLK_TYPE parameter set to asynchronous (1), there is a two ic_clk delay when enabling or disabling the DW_apb_i2c. For a detailed description on how to disable DW_apb_i2c, refer to 'Disabling DW_apb_i2c'
5920 //
5921 // Reset value: 0x0
5922 ADD_BITFIELD_RW(ENABLE, 0, 1)
5923 END_TYPE()
5924
5925 // Tx Command execution not blocked
5926 static const uint32_t IC_ENABLE_TX_CMD_BLOCK__NOT_BLOCKED = 0;
5927 // Tx Command execution blocked
5928 static const uint32_t IC_ENABLE_TX_CMD_BLOCK__BLOCKED = 1;
5929 // ABORT operation not in progress
5930 static const uint32_t IC_ENABLE_ABORT__DISABLE = 0;
5931 // ABORT operation in progress
5932 static const uint32_t IC_ENABLE_ABORT__ENABLED = 1;
5933 // I2C is disabled
5934 static const uint32_t IC_ENABLE_ENABLE__DISABLED = 0;
5935 // I2C is enabled
5936 static const uint32_t IC_ENABLE_ENABLE__ENABLED = 1;
5937
5938 // I2C Status Register
5939 //
5940 // This is a read-only register used to indicate the current transfer status and FIFO status. The status register may be read at any time. None of the bits in this register request an interrupt.
5941 //
5942 // When the I2C is disabled by writing 0 in bit 0 of the IC_ENABLE register: - Bits 1 and 2 are set to 1 - Bits 3 and 10 are set to 0 When the master or slave state machines goes to idle and ic_en=0: - Bits 5 and 6 are set to 0
5943 // Reset value: 0x00000006
5944 BEGIN_TYPE(IC_STATUS_t, uint32_t)
5945 // Slave FSM Activity Status. When the Slave Finite State Machine (FSM) is not in the IDLE state, this bit is set. - 0: Slave FSM is in IDLE state so the Slave part of DW_apb_i2c is not Active - 1: Slave FSM is not in IDLE state so the Slave part of DW_apb_i2c is Active Reset value: 0x0
5946 ADD_BITFIELD_RO(SLV_ACTIVITY, 6, 1)
5947 // Master FSM Activity Status. When the Master Finite State Machine (FSM) is not in the IDLE state, this bit is set. - 0: Master FSM is in IDLE state so the Master part of DW_apb_i2c is not Active - 1: Master FSM is not in IDLE state so the Master part of DW_apb_i2c is Active Note: IC_STATUS[0]-that is, ACTIVITY bit-is the OR of SLV_ACTIVITY and MST_ACTIVITY bits.
5948 //
5949 // Reset value: 0x0
5950 ADD_BITFIELD_RO(MST_ACTIVITY, 5, 1)
5951 // Receive FIFO Completely Full. When the receive FIFO is completely full, this bit is set. When the receive FIFO contains one or more empty location, this bit is cleared. - 0: Receive FIFO is not full - 1: Receive FIFO is full Reset value: 0x0
5952 ADD_BITFIELD_RO(RFF, 4, 1)
5953 // Receive FIFO Not Empty. This bit is set when the receive FIFO contains one or more entries; it is cleared when the receive FIFO is empty. - 0: Receive FIFO is empty - 1: Receive FIFO is not empty Reset value: 0x0
5954 ADD_BITFIELD_RO(RFNE, 3, 1)
5955 // Transmit FIFO Completely Empty. When the transmit FIFO is completely empty, this bit is set. When it contains one or more valid entries, this bit is cleared. This bit field does not request an interrupt. - 0: Transmit FIFO is not empty - 1: Transmit FIFO is empty Reset value: 0x1
5956 ADD_BITFIELD_RO(TFE, 2, 1)
5957 // Transmit FIFO Not Full. Set when the transmit FIFO contains one or more empty locations, and is cleared when the FIFO is full. - 0: Transmit FIFO is full - 1: Transmit FIFO is not full Reset value: 0x1
5958 ADD_BITFIELD_RO(TFNF, 1, 1)
5959 // I2C Activity Status. Reset value: 0x0
5960 ADD_BITFIELD_RO(ACTIVITY, 0, 1)
5961 END_TYPE()
5962
5963 // Slave is idle
5964 static const uint32_t IC_STATUS_SLV_ACTIVITY__IDLE = 0;
5965 // Slave not idle
5966 static const uint32_t IC_STATUS_SLV_ACTIVITY__ACTIVE = 1;
5967 // Master is idle
5968 static const uint32_t IC_STATUS_MST_ACTIVITY__IDLE = 0;
5969 // Master not idle
5970 static const uint32_t IC_STATUS_MST_ACTIVITY__ACTIVE = 1;
5971 // Rx FIFO not full
5972 static const uint32_t IC_STATUS_RFF__NOT_FULL = 0;
5973 // Rx FIFO is full
5974 static const uint32_t IC_STATUS_RFF__FULL = 1;
5975 // Rx FIFO is empty
5976 static const uint32_t IC_STATUS_RFNE__EMPTY = 0;
5977 // Rx FIFO not empty
5978 static const uint32_t IC_STATUS_RFNE__NOT_EMPTY = 1;
5979 // Tx FIFO not empty
5980 static const uint32_t IC_STATUS_TFE__NON_EMPTY = 0;
5981 // Tx FIFO is empty
5982 static const uint32_t IC_STATUS_TFE__EMPTY = 1;
5983 // Tx FIFO is full
5984 static const uint32_t IC_STATUS_TFNF__FULL = 0;
5985 // Tx FIFO not full
5986 static const uint32_t IC_STATUS_TFNF__NOT_FULL = 1;
5987 // I2C is idle
5988 static const uint32_t IC_STATUS_ACTIVITY__INACTIVE = 0;
5989 // I2C is active
5990 static const uint32_t IC_STATUS_ACTIVITY__ACTIVE = 1;
5991
5992 // I2C Transmit FIFO Level Register This register contains the number of valid data entries in the transmit FIFO buffer. It is cleared whenever: - The I2C is disabled - There is a transmit abort - that is, TX_ABRT bit is set in the IC_RAW_INTR_STAT register - The slave bulk transmit mode is aborted The register increments whenever data is placed into the transmit FIFO and decrements when data is taken from the transmit FIFO.
5993 // Reset value: 0x00000000
5994 BEGIN_TYPE(IC_TXFLR_t, uint32_t)
5995 // Transmit FIFO Level. Contains the number of valid data entries in the transmit FIFO.
5996 //
5997 // Reset value: 0x0
5998 ADD_BITFIELD_RO(TXFLR, 0, 5)
5999 END_TYPE()
6000
6001 // I2C Receive FIFO Level Register This register contains the number of valid data entries in the receive FIFO buffer. It is cleared whenever: - The I2C is disabled - Whenever there is a transmit abort caused by any of the events tracked in IC_TX_ABRT_SOURCE The register increments whenever data is placed into the receive FIFO and decrements when data is taken from the receive FIFO.
6002 // Reset value: 0x00000000
6003 BEGIN_TYPE(IC_RXFLR_t, uint32_t)
6004 // Receive FIFO Level. Contains the number of valid data entries in the receive FIFO.
6005 //
6006 // Reset value: 0x0
6007 ADD_BITFIELD_RO(RXFLR, 0, 5)
6008 END_TYPE()
6009
6010 // I2C SDA Hold Time Length Register
6011 //
6012 // The bits [15:0] of this register are used to control the hold time of SDA during transmit in both slave and master mode (after SCL goes from HIGH to LOW).
6013 //
6014 // The bits [23:16] of this register are used to extend the SDA transition (if any) whenever SCL is HIGH in the receiver in either master or slave mode.
6015 //
6016 // Writes to this register succeed only when IC_ENABLE[0]=0.
6017 //
6018 // The values in this register are in units of ic_clk period. The value programmed in IC_SDA_TX_HOLD must be greater than the minimum hold time in each mode (one cycle in master mode, seven cycles in slave mode) for the value to be implemented.
6019 //
6020 // The programmed SDA hold time during transmit (IC_SDA_TX_HOLD) cannot exceed at any time the duration of the low part of scl. Therefore the programmed value cannot be larger than N_SCL_LOW-2, where N_SCL_LOW is the duration of the low part of the scl period measured in ic_clk cycles.
6021 // Reset value: 0x00000001
6022 BEGIN_TYPE(IC_SDA_HOLD_t, uint32_t)
6023 // Sets the required SDA hold time in units of ic_clk period, when DW_apb_i2c acts as a receiver.
6024 //
6025 // Reset value: IC_DEFAULT_SDA_HOLD[23:16].
6026 ADD_BITFIELD_RW(IC_SDA_RX_HOLD, 16, 8)
6027 // Sets the required SDA hold time in units of ic_clk period, when DW_apb_i2c acts as a transmitter.
6028 //
6029 // Reset value: IC_DEFAULT_SDA_HOLD[15:0].
6030 ADD_BITFIELD_RW(IC_SDA_TX_HOLD, 0, 16)
6031 END_TYPE()
6032
6033 // I2C Transmit Abort Source Register
6034 //
6035 // This register has 32 bits that indicate the source of the TX_ABRT bit. Except for Bit 9, this register is cleared whenever the IC_CLR_TX_ABRT register or the IC_CLR_INTR register is read. To clear Bit 9, the source of the ABRT_SBYTE_NORSTRT must be fixed first; RESTART must be enabled (IC_CON[5]=1), the SPECIAL bit must be cleared (IC_TAR[11]), or the GC_OR_START bit must be cleared (IC_TAR[10]).
6036 //
6037 // Once the source of the ABRT_SBYTE_NORSTRT is fixed, then this bit can be cleared in the same manner as other bits in this register. If the source of the ABRT_SBYTE_NORSTRT is not fixed before attempting to clear this bit, Bit 9 clears for one cycle and is then re-asserted.
6038 // Reset value: 0x00000000
6039 BEGIN_TYPE(IC_TX_ABRT_SOURCE_t, uint32_t)
6040 // This field indicates the number of Tx FIFO Data Commands which are flushed due to TX_ABRT interrupt. It is cleared whenever I2C is disabled.
6041 //
6042 // Reset value: 0x0
6043 //
6044 // Role of DW_apb_i2c: Master-Transmitter or Slave-Transmitter
6045 ADD_BITFIELD_RO(TX_FLUSH_CNT, 23, 9)
6046 // This is a master-mode-only bit. Master has detected the transfer abort (IC_ENABLE[1])
6047 //
6048 // Reset value: 0x0
6049 //
6050 // Role of DW_apb_i2c: Master-Transmitter
6051 ADD_BITFIELD_RO(ABRT_USER_ABRT, 16, 1)
6052 // 1: When the processor side responds to a slave mode request for data to be transmitted to a remote master and user writes a 1 in CMD (bit 8) of IC_DATA_CMD register.
6053 //
6054 // Reset value: 0x0
6055 //
6056 // Role of DW_apb_i2c: Slave-Transmitter
6057 ADD_BITFIELD_RO(ABRT_SLVRD_INTX, 15, 1)
6058 // This field indicates that a Slave has lost the bus while transmitting data to a remote master. IC_TX_ABRT_SOURCE[12] is set at the same time. Note: Even though the slave never 'owns' the bus, something could go wrong on the bus. This is a fail safe check. For instance, during a data transmission at the low-to-high transition of SCL, if what is on the data bus is not what is supposed to be transmitted, then DW_apb_i2c no longer own the bus.
6059 //
6060 // Reset value: 0x0
6061 //
6062 // Role of DW_apb_i2c: Slave-Transmitter
6063 ADD_BITFIELD_RO(ABRT_SLV_ARBLOST, 14, 1)
6064 // This field specifies that the Slave has received a read command and some data exists in the TX FIFO, so the slave issues a TX_ABRT interrupt to flush old data in TX FIFO.
6065 //
6066 // Reset value: 0x0
6067 //
6068 // Role of DW_apb_i2c: Slave-Transmitter
6069 ADD_BITFIELD_RO(ABRT_SLVFLUSH_TXFIFO, 13, 1)
6070 // This field specifies that the Master has lost arbitration, or if IC_TX_ABRT_SOURCE[14] is also set, then the slave transmitter has lost arbitration.
6071 //
6072 // Reset value: 0x0
6073 //
6074 // Role of DW_apb_i2c: Master-Transmitter or Slave-Transmitter
6075 ADD_BITFIELD_RO(ARB_LOST, 12, 1)
6076 // This field indicates that the User tries to initiate a Master operation with the Master mode disabled.
6077 //
6078 // Reset value: 0x0
6079 //
6080 // Role of DW_apb_i2c: Master-Transmitter or Master-Receiver
6081 ADD_BITFIELD_RO(ABRT_MASTER_DIS, 11, 1)
6082 // This field indicates that the restart is disabled (IC_RESTART_EN bit (IC_CON[5]) =0) and the master sends a read command in 10-bit addressing mode.
6083 //
6084 // Reset value: 0x0
6085 //
6086 // Role of DW_apb_i2c: Master-Receiver
6087 ADD_BITFIELD_RO(ABRT_10B_RD_NORSTRT, 10, 1)
6088 // To clear Bit 9, the source of the ABRT_SBYTE_NORSTRT must be fixed first; restart must be enabled (IC_CON[5]=1), the SPECIAL bit must be cleared (IC_TAR[11]), or the GC_OR_START bit must be cleared (IC_TAR[10]). Once the source of the ABRT_SBYTE_NORSTRT is fixed, then this bit can be cleared in the same manner as other bits in this register. If the source of the ABRT_SBYTE_NORSTRT is not fixed before attempting to clear this bit, bit 9 clears for one cycle and then gets reasserted. When this field is set to 1, the restart is disabled (IC_RESTART_EN bit (IC_CON[5]) =0) and the user is trying to send a START Byte.
6089 //
6090 // Reset value: 0x0
6091 //
6092 // Role of DW_apb_i2c: Master
6093 ADD_BITFIELD_RO(ABRT_SBYTE_NORSTRT, 9, 1)
6094 // This field indicates that the restart is disabled (IC_RESTART_EN bit (IC_CON[5]) =0) and the user is trying to use the master to transfer data in High Speed mode.
6095 //
6096 // Reset value: 0x0
6097 //
6098 // Role of DW_apb_i2c: Master-Transmitter or Master-Receiver
6099 ADD_BITFIELD_RO(ABRT_HS_NORSTRT, 8, 1)
6100 // This field indicates that the Master has sent a START Byte and the START Byte was acknowledged (wrong behavior).
6101 //
6102 // Reset value: 0x0
6103 //
6104 // Role of DW_apb_i2c: Master
6105 ADD_BITFIELD_RO(ABRT_SBYTE_ACKDET, 7, 1)
6106 // This field indicates that the Master is in High Speed mode and the High Speed Master code was acknowledged (wrong behavior).
6107 //
6108 // Reset value: 0x0
6109 //
6110 // Role of DW_apb_i2c: Master
6111 ADD_BITFIELD_RO(ABRT_HS_ACKDET, 6, 1)
6112 // This field indicates that DW_apb_i2c in the master mode has sent a General Call but the user programmed the byte following the General Call to be a read from the bus (IC_DATA_CMD[9] is set to 1).
6113 //
6114 // Reset value: 0x0
6115 //
6116 // Role of DW_apb_i2c: Master-Transmitter
6117 ADD_BITFIELD_RO(ABRT_GCALL_READ, 5, 1)
6118 // This field indicates that DW_apb_i2c in master mode has sent a General Call and no slave on the bus acknowledged the General Call.
6119 //
6120 // Reset value: 0x0
6121 //
6122 // Role of DW_apb_i2c: Master-Transmitter
6123 ADD_BITFIELD_RO(ABRT_GCALL_NOACK, 4, 1)
6124 // This field indicates the master-mode only bit. When the master receives an acknowledgement for the address, but when it sends data byte(s) following the address, it did not receive an acknowledge from the remote slave(s).
6125 //
6126 // Reset value: 0x0
6127 //
6128 // Role of DW_apb_i2c: Master-Transmitter
6129 ADD_BITFIELD_RO(ABRT_TXDATA_NOACK, 3, 1)
6130 // This field indicates that the Master is in 10-bit address mode and that the second address byte of the 10-bit address was not acknowledged by any slave.
6131 //
6132 // Reset value: 0x0
6133 //
6134 // Role of DW_apb_i2c: Master-Transmitter or Master-Receiver
6135 ADD_BITFIELD_RO(ABRT_10ADDR2_NOACK, 2, 1)
6136 // This field indicates that the Master is in 10-bit address mode and the first 10-bit address byte was not acknowledged by any slave.
6137 //
6138 // Reset value: 0x0
6139 //
6140 // Role of DW_apb_i2c: Master-Transmitter or Master-Receiver
6141 ADD_BITFIELD_RO(ABRT_10ADDR1_NOACK, 1, 1)
6142 // This field indicates that the Master is in 7-bit addressing mode and the address sent was not acknowledged by any slave.
6143 //
6144 // Reset value: 0x0
6145 //
6146 // Role of DW_apb_i2c: Master-Transmitter or Master-Receiver
6147 ADD_BITFIELD_RO(ABRT_7B_ADDR_NOACK, 0, 1)
6148 END_TYPE()
6149
6150 // Transfer abort detected by master- scenario not present
6151 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_USER_ABRT__ABRT_USER_ABRT_VOID = 0;
6152 // Transfer abort detected by master
6153 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_USER_ABRT__ABRT_USER_ABRT_GENERATED = 1;
6154 // Slave trying to transmit to remote master in read mode- scenario not present
6155 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_SLVRD_INTX__ABRT_SLVRD_INTX_VOID = 0;
6156 // Slave trying to transmit to remote master in read mode
6157 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_SLVRD_INTX__ABRT_SLVRD_INTX_GENERATED = 1;
6158 // Slave lost arbitration to remote master- scenario not present
6159 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_SLV_ARBLOST__ABRT_SLV_ARBLOST_VOID = 0;
6160 // Slave lost arbitration to remote master
6161 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_SLV_ARBLOST__ABRT_SLV_ARBLOST_GENERATED = 1;
6162 // Slave flushes existing data in TX-FIFO upon getting read command- scenario not present
6163 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_SLVFLUSH_TXFIFO__ABRT_SLVFLUSH_TXFIFO_VOID = 0;
6164 // Slave flushes existing data in TX-FIFO upon getting read command
6165 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_SLVFLUSH_TXFIFO__ABRT_SLVFLUSH_TXFIFO_GENERATED = 1;
6166 // Master or Slave-Transmitter lost arbitration- scenario not present
6167 static const uint32_t IC_TX_ABRT_SOURCE_ARB_LOST__ABRT_LOST_VOID = 0;
6168 // Master or Slave-Transmitter lost arbitration
6169 static const uint32_t IC_TX_ABRT_SOURCE_ARB_LOST__ABRT_LOST_GENERATED = 1;
6170 // User initiating master operation when MASTER disabled- scenario not present
6171 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_MASTER_DIS__ABRT_MASTER_DIS_VOID = 0;
6172 // User initiating master operation when MASTER disabled
6173 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_MASTER_DIS__ABRT_MASTER_DIS_GENERATED = 1;
6174 // Master not trying to read in 10Bit addressing mode when RESTART disabled
6175 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_10B_RD_NORSTRT__ABRT_10B_RD_VOID = 0;
6176 // Master trying to read in 10Bit addressing mode when RESTART disabled
6177 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_10B_RD_NORSTRT__ABRT_10B_RD_GENERATED = 1;
6178 // User trying to send START byte when RESTART disabled- scenario not present
6179 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_SBYTE_NORSTRT__ABRT_SBYTE_NORSTRT_VOID = 0;
6180 // User trying to send START byte when RESTART disabled
6181 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_SBYTE_NORSTRT__ABRT_SBYTE_NORSTRT_GENERATED = 1;
6182 // User trying to switch Master to HS mode when RESTART disabled- scenario not present
6183 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_HS_NORSTRT__ABRT_HS_NORSTRT_VOID = 0;
6184 // User trying to switch Master to HS mode when RESTART disabled
6185 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_HS_NORSTRT__ABRT_HS_NORSTRT_GENERATED = 1;
6186 // ACK detected for START byte- scenario not present
6187 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_SBYTE_ACKDET__ABRT_SBYTE_ACKDET_VOID = 0;
6188 // ACK detected for START byte
6189 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_SBYTE_ACKDET__ABRT_SBYTE_ACKDET_GENERATED = 1;
6190 // HS Master code ACKed in HS Mode- scenario not present
6191 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_HS_ACKDET__ABRT_HS_ACK_VOID = 0;
6192 // HS Master code ACKed in HS Mode
6193 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_HS_ACKDET__ABRT_HS_ACK_GENERATED = 1;
6194 // GCALL is followed by read from bus-scenario not present
6195 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_GCALL_READ__ABRT_GCALL_READ_VOID = 0;
6196 // GCALL is followed by read from bus
6197 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_GCALL_READ__ABRT_GCALL_READ_GENERATED = 1;
6198 // GCALL not ACKed by any slave-scenario not present
6199 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_GCALL_NOACK__ABRT_GCALL_NOACK_VOID = 0;
6200 // GCALL not ACKed by any slave
6201 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_GCALL_NOACK__ABRT_GCALL_NOACK_GENERATED = 1;
6202 // Transmitted data non-ACKed by addressed slave-scenario not present
6203 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_TXDATA_NOACK__ABRT_TXDATA_NOACK_VOID = 0;
6204 // Transmitted data not ACKed by addressed slave
6205 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_TXDATA_NOACK__ABRT_TXDATA_NOACK_GENERATED = 1;
6206 // This abort is not generated
6207 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_10ADDR2_NOACK__INACTIVE = 0;
6208 // Byte 2 of 10Bit Address not ACKed by any slave
6209 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_10ADDR2_NOACK__ACTIVE = 1;
6210 // This abort is not generated
6211 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_10ADDR1_NOACK__INACTIVE = 0;
6212 // Byte 1 of 10Bit Address not ACKed by any slave
6213 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_10ADDR1_NOACK__ACTIVE = 1;
6214 // This abort is not generated
6215 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_7B_ADDR_NOACK__INACTIVE = 0;
6216 // This abort is generated because of NOACK for 7-bit address
6217 static const uint32_t IC_TX_ABRT_SOURCE_ABRT_7B_ADDR_NOACK__ACTIVE = 1;
6218
6219 // Generate Slave Data NACK Register
6220 //
6221 // The register is used to generate a NACK for the data part of a transfer when DW_apb_i2c is acting as a slave-receiver. This register only exists when the IC_SLV_DATA_NACK_ONLY parameter is set to 1. When this parameter disabled, this register does not exist and writing to the register's address has no effect.
6222 //
6223 // A write can occur on this register if both of the following conditions are met: - DW_apb_i2c is disabled (IC_ENABLE[0] = 0) - Slave part is inactive (IC_STATUS[6] = 0) Note: The IC_STATUS[6] is a register read-back location for the internal slv_activity signal; the user should poll this before writing the ic_slv_data_nack_only bit.
6224 // Reset value: 0x00000000
6225 BEGIN_TYPE(IC_SLV_DATA_NACK_ONLY_t, uint32_t)
6226 // Generate NACK. This NACK generation only occurs when DW_apb_i2c is a slave-receiver. If this register is set to a value of 1, it can only generate a NACK after a data byte is received; hence, the data transfer is aborted and the data received is not pushed to the receive buffer.
6227 //
6228 // When the register is set to a value of 0, it generates NACK/ACK, depending on normal criteria. - 1: generate NACK after data byte received - 0: generate NACK/ACK normally Reset value: 0x0
6229 ADD_BITFIELD_RW(NACK, 0, 1)
6230 END_TYPE()
6231
6232 // Slave receiver generates NACK normally
6233 static const uint32_t IC_SLV_DATA_NACK_ONLY_NACK__DISABLED = 0;
6234 // Slave receiver generates NACK upon data reception only
6235 static const uint32_t IC_SLV_DATA_NACK_ONLY_NACK__ENABLED = 1;
6236
6237 // DMA Control Register
6238 //
6239 // The register is used to enable the DMA Controller interface operation. There is a separate bit for transmit and receive. This can be programmed regardless of the state of IC_ENABLE.
6240 // Reset value: 0x00000000
6241 BEGIN_TYPE(IC_DMA_CR_t, uint32_t)
6242 // Transmit DMA Enable. This bit enables/disables the transmit FIFO DMA channel. Reset value: 0x0
6243 ADD_BITFIELD_RW(TDMAE, 1, 1)
6244 // Receive DMA Enable. This bit enables/disables the receive FIFO DMA channel. Reset value: 0x0
6245 ADD_BITFIELD_RW(RDMAE, 0, 1)
6246 END_TYPE()
6247
6248 // transmit FIFO DMA channel disabled
6249 static const uint32_t IC_DMA_CR_TDMAE__DISABLED = 0;
6250 // Transmit FIFO DMA channel enabled
6251 static const uint32_t IC_DMA_CR_TDMAE__ENABLED = 1;
6252 // Receive FIFO DMA channel disabled
6253 static const uint32_t IC_DMA_CR_RDMAE__DISABLED = 0;
6254 // Receive FIFO DMA channel enabled
6255 static const uint32_t IC_DMA_CR_RDMAE__ENABLED = 1;
6256
6257 // DMA Transmit Data Level Register
6258 // Reset value: 0x00000000
6259 BEGIN_TYPE(IC_DMA_TDLR_t, uint32_t)
6260 // Transmit Data Level. This bit field controls the level at which a DMA request is made by the transmit logic. It is equal to the watermark level; that is, the dma_tx_req signal is generated when the number of valid data entries in the transmit FIFO is equal to or below this field value, and TDMAE = 1.
6261 //
6262 // Reset value: 0x0
6263 ADD_BITFIELD_RW(DMATDL, 0, 4)
6264 END_TYPE()
6265
6266 // I2C Receive Data Level Register
6267 // Reset value: 0x00000000
6268 BEGIN_TYPE(IC_DMA_RDLR_t, uint32_t)
6269 // Receive Data Level. This bit field controls the level at which a DMA request is made by the receive logic. The watermark level = DMARDL+1; that is, dma_rx_req is generated when the number of valid data entries in the receive FIFO is equal to or more than this field value + 1, and RDMAE =1. For instance, when DMARDL is 0, then dma_rx_req is asserted when 1 or more data entries are present in the receive FIFO.
6270 //
6271 // Reset value: 0x0
6272 ADD_BITFIELD_RW(DMARDL, 0, 4)
6273 END_TYPE()
6274
6275 // I2C SDA Setup Register
6276 //
6277 // This register controls the amount of time delay (in terms of number of ic_clk clock periods) introduced in the rising edge of SCL - relative to SDA changing - when DW_apb_i2c services a read request in a slave-transmitter operation. The relevant I2C requirement is tSU:DAT (note 4) as detailed in the I2C Bus Specification. This register must be programmed with a value equal to or greater than 2.
6278 //
6279 // Writes to this register succeed only when IC_ENABLE[0] = 0.
6280 //
6281 // Note: The length of setup time is calculated using [(IC_SDA_SETUP - 1) * (ic_clk_period)], so if the user requires 10 ic_clk periods of setup time, they should program a value of 11. The IC_SDA_SETUP register is only used by the DW_apb_i2c when operating as a slave transmitter.
6282 // Reset value: 0x00000064
6283 BEGIN_TYPE(IC_SDA_SETUP_t, uint32_t)
6284 // SDA Setup. It is recommended that if the required delay is 1000ns, then for an ic_clk frequency of 10 MHz, IC_SDA_SETUP should be programmed to a value of 11. IC_SDA_SETUP must be programmed with a minimum value of 2.
6285 ADD_BITFIELD_RW(SDA_SETUP, 0, 8)
6286 END_TYPE()
6287
6288 // I2C ACK General Call Register
6289 //
6290 // The register controls whether DW_apb_i2c responds with a ACK or NACK when it receives an I2C General Call address.
6291 //
6292 // This register is applicable only when the DW_apb_i2c is in slave mode.
6293 // Reset value: 0x00000001
6294 BEGIN_TYPE(IC_ACK_GENERAL_CALL_t, uint32_t)
6295 // ACK General Call. When set to 1, DW_apb_i2c responds with a ACK (by asserting ic_data_oe) when it receives a General Call. Otherwise, DW_apb_i2c responds with a NACK (by negating ic_data_oe).
6296 ADD_BITFIELD_RW(ACK_GEN_CALL, 0, 1)
6297 END_TYPE()
6298
6299 // Generate NACK for a General Call
6300 static const uint32_t IC_ACK_GENERAL_CALL_ACK_GEN_CALL__DISABLED = 0;
6301 // Generate ACK for a General Call
6302 static const uint32_t IC_ACK_GENERAL_CALL_ACK_GEN_CALL__ENABLED = 1;
6303
6304 // I2C Enable Status Register
6305 //
6306 // The register is used to report the DW_apb_i2c hardware status when the IC_ENABLE[0] register is set from 1 to 0; that is, when DW_apb_i2c is disabled.
6307 //
6308 // If IC_ENABLE[0] has been set to 1, bits 2:1 are forced to 0, and bit 0 is forced to 1.
6309 //
6310 // If IC_ENABLE[0] has been set to 0, bits 2:1 is only be valid as soon as bit 0 is read as '0'.
6311 //
6312 // Note: When IC_ENABLE[0] has been set to 0, a delay occurs for bit 0 to be read as 0 because disabling the DW_apb_i2c depends on I2C bus activities.
6313 // Reset value: 0x00000000
6314 BEGIN_TYPE(IC_ENABLE_STATUS_t, uint32_t)
6315 // Slave Received Data Lost. This bit indicates if a Slave-Receiver operation has been aborted with at least one data byte received from an I2C transfer due to the setting bit 0 of IC_ENABLE from 1 to 0. When read as 1, DW_apb_i2c is deemed to have been actively engaged in an aborted I2C transfer (with matching address) and the data phase of the I2C transfer has been entered, even though a data byte has been responded with a NACK.
6316 //
6317 // Note: If the remote I2C master terminates the transfer with a STOP condition before the DW_apb_i2c has a chance to NACK a transfer, and IC_ENABLE[0] has been set to 0, then this bit is also set to 1.
6318 //
6319 // When read as 0, DW_apb_i2c is deemed to have been disabled without being actively involved in the data phase of a Slave-Receiver transfer.
6320 //
6321 // Note: The CPU can safely read this bit when IC_EN (bit 0) is read as 0.
6322 //
6323 // Reset value: 0x0
6324 ADD_BITFIELD_RO(SLV_RX_DATA_LOST, 2, 1)
6325 // Slave Disabled While Busy (Transmit, Receive). This bit indicates if a potential or active Slave operation has been aborted due to the setting bit 0 of the IC_ENABLE register from 1 to 0. This bit is set when the CPU writes a 0 to the IC_ENABLE register while:
6326 //
6327 // (a) DW_apb_i2c is receiving the address byte of the Slave-Transmitter operation from a remote master;
6328 //
6329 // OR,
6330 //
6331 // (b) address and data bytes of the Slave-Receiver operation from a remote master.
6332 //
6333 // When read as 1, DW_apb_i2c is deemed to have forced a NACK during any part of an I2C transfer, irrespective of whether the I2C address matches the slave address set in DW_apb_i2c (IC_SAR register) OR if the transfer is completed before IC_ENABLE is set to 0 but has not taken effect.
6334 //
6335 // Note: If the remote I2C master terminates the transfer with a STOP condition before the DW_apb_i2c has a chance to NACK a transfer, and IC_ENABLE[0] has been set to 0, then this bit will also be set to 1.
6336 //
6337 // When read as 0, DW_apb_i2c is deemed to have been disabled when there is master activity, or when the I2C bus is idle.
6338 //
6339 // Note: The CPU can safely read this bit when IC_EN (bit 0) is read as 0.
6340 //
6341 // Reset value: 0x0
6342 ADD_BITFIELD_RO(SLV_DISABLED_WHILE_BUSY, 1, 1)
6343 // ic_en Status. This bit always reflects the value driven on the output port ic_en. - When read as 1, DW_apb_i2c is deemed to be in an enabled state. - When read as 0, DW_apb_i2c is deemed completely inactive. Note: The CPU can safely read this bit anytime. When this bit is read as 0, the CPU can safely read SLV_RX_DATA_LOST (bit 2) and SLV_DISABLED_WHILE_BUSY (bit 1).
6344 //
6345 // Reset value: 0x0
6346 ADD_BITFIELD_RO(IC_EN, 0, 1)
6347 END_TYPE()
6348
6349 // Slave RX Data is not lost
6350 static const uint32_t IC_ENABLE_STATUS_SLV_RX_DATA_LOST__INACTIVE = 0;
6351 // Slave RX Data is lost
6352 static const uint32_t IC_ENABLE_STATUS_SLV_RX_DATA_LOST__ACTIVE = 1;
6353 // Slave is disabled when it is idle
6354 static const uint32_t IC_ENABLE_STATUS_SLV_DISABLED_WHILE_BUSY__INACTIVE = 0;
6355 // Slave is disabled when it is active
6356 static const uint32_t IC_ENABLE_STATUS_SLV_DISABLED_WHILE_BUSY__ACTIVE = 1;
6357 // I2C disabled
6358 static const uint32_t IC_ENABLE_STATUS_IC_EN__DISABLED = 0;
6359 // I2C enabled
6360 static const uint32_t IC_ENABLE_STATUS_IC_EN__ENABLED = 1;
6361
6362 // I2C SS, FS or FM+ spike suppression limit
6363 //
6364 // This register is used to store the duration, measured in ic_clk cycles, of the longest spike that is filtered out by the spike suppression logic when the component is operating in SS, FS or FM+ modes. The relevant I2C requirement is tSP (table 4) as detailed in the I2C Bus Specification. This register must be programmed with a minimum value of 1.
6365 // Reset value: 0x00000007
6366 BEGIN_TYPE(IC_FS_SPKLEN_t, uint32_t)
6367 // This register must be set before any I2C bus transaction can take place to ensure stable operation. This register sets the duration, measured in ic_clk cycles, of the longest spike in the SCL or SDA lines that will be filtered out by the spike suppression logic. This register can be written only when the I2C interface is disabled which corresponds to the IC_ENABLE[0] register being set to 0. Writes at other times have no effect. The minimum valid value is 1; hardware prevents values less than this being written, and if attempted results in 1 being set. or more information, refer to 'Spike Suppression'.
6368 ADD_BITFIELD_RW(IC_FS_SPKLEN, 0, 8)
6369 END_TYPE()
6370
6371 // Clear RESTART_DET Interrupt Register
6372 // Reset value: 0x00000000
6373 BEGIN_TYPE(IC_CLR_RESTART_DET_t, uint32_t)
6374 // Read this register to clear the RESTART_DET interrupt (bit 12) of IC_RAW_INTR_STAT register.
6375 //
6376 // Reset value: 0x0
6377 ADD_BITFIELD_RO(CLR_RESTART_DET, 0, 1)
6378 END_TYPE()
6379
6380 // Component Parameter Register 1
6381 //
6382 // Note This register is not implemented and therefore reads as 0. If it was implemented it would be a constant read-only register that contains encoded information about the component's parameter settings. Fields shown below are the settings for those parameters
6383 // Reset value: 0x00000000
6384 BEGIN_TYPE(IC_COMP_PARAM_1_t, uint32_t)
6385 // TX Buffer Depth = 16
6386 ADD_BITFIELD_RO(TX_BUFFER_DEPTH, 16, 8)
6387 // RX Buffer Depth = 16
6388 ADD_BITFIELD_RO(RX_BUFFER_DEPTH, 8, 8)
6389 // Encoded parameters not visible
6390 ADD_BITFIELD_RO(ADD_ENCODED_PARAMS, 7, 1)
6391 // DMA handshaking signals are enabled
6392 ADD_BITFIELD_RO(HAS_DMA, 6, 1)
6393 // COMBINED Interrupt outputs
6394 ADD_BITFIELD_RO(INTR_IO, 5, 1)
6395 // Programmable count values for each mode.
6396 ADD_BITFIELD_RO(HC_COUNT_VALUES, 4, 1)
6397 // MAX SPEED MODE = FAST MODE
6398 ADD_BITFIELD_RO(MAX_SPEED_MODE, 2, 2)
6399 // APB data bus width is 32 bits
6400 ADD_BITFIELD_RO(APB_DATA_WIDTH, 0, 2)
6401 END_TYPE()
6402
6403 // I2C Component Version Register
6404 // Reset value: 0x3230312a
6405 BEGIN_TYPE(IC_COMP_VERSION_t, uint32_t)
6406 ADD_BITFIELD_RO(IC_COMP_VERSION, 0, 32)
6407 END_TYPE()
6408
6409 // I2C Component Type Register
6410 // Reset value: 0x44570140
6411 BEGIN_TYPE(IC_COMP_TYPE_t, uint32_t)
6412 // Designware Component Type number = 0x44_57_01_40. This assigned unique hex value is constant and is derived from the two ASCII letters 'DW' followed by a 16-bit unsigned number.
6413 ADD_BITFIELD_RO(IC_COMP_TYPE, 0, 32)
6414 END_TYPE()
6415
6416 struct I2C0_t {
6417 IC_CON_t IC_CON;
6418 IC_TAR_t IC_TAR;
6419 IC_SAR_t IC_SAR;
6420 uint32_t reserved0;
6421 IC_DATA_CMD_t IC_DATA_CMD;
6422 IC_SS_SCL_HCNT_t IC_SS_SCL_HCNT;
6423 IC_SS_SCL_LCNT_t IC_SS_SCL_LCNT;
6424 IC_FS_SCL_HCNT_t IC_FS_SCL_HCNT;
6425 IC_FS_SCL_LCNT_t IC_FS_SCL_LCNT;
6426 uint32_t reserved1[2];
6427 IC_INTR_STAT_t IC_INTR_STAT;
6428 IC_INTR_MASK_t IC_INTR_MASK;
6429 IC_RAW_INTR_STAT_t IC_RAW_INTR_STAT;
6430 IC_RX_TL_t IC_RX_TL;
6431 IC_TX_TL_t IC_TX_TL;
6432 IC_CLR_INTR_t IC_CLR_INTR;
6433 IC_CLR_RX_UNDER_t IC_CLR_RX_UNDER;
6434 IC_CLR_RX_OVER_t IC_CLR_RX_OVER;
6435 IC_CLR_TX_OVER_t IC_CLR_TX_OVER;
6436 IC_CLR_RD_REQ_t IC_CLR_RD_REQ;
6437 IC_CLR_TX_ABRT_t IC_CLR_TX_ABRT;
6438 IC_CLR_RX_DONE_t IC_CLR_RX_DONE;
6439 IC_CLR_ACTIVITY_t IC_CLR_ACTIVITY;
6440 IC_CLR_STOP_DET_t IC_CLR_STOP_DET;
6441 IC_CLR_START_DET_t IC_CLR_START_DET;
6442 IC_CLR_GEN_CALL_t IC_CLR_GEN_CALL;
6443 IC_ENABLE_t IC_ENABLE;
6444 IC_STATUS_t IC_STATUS;
6445 IC_TXFLR_t IC_TXFLR;
6446 IC_RXFLR_t IC_RXFLR;
6447 IC_SDA_HOLD_t IC_SDA_HOLD;
6448 IC_TX_ABRT_SOURCE_t IC_TX_ABRT_SOURCE;
6449 IC_SLV_DATA_NACK_ONLY_t IC_SLV_DATA_NACK_ONLY;
6450 IC_DMA_CR_t IC_DMA_CR;
6451 IC_DMA_TDLR_t IC_DMA_TDLR;
6452 IC_DMA_RDLR_t IC_DMA_RDLR;
6453 IC_SDA_SETUP_t IC_SDA_SETUP;
6454 IC_ACK_GENERAL_CALL_t IC_ACK_GENERAL_CALL;
6455 IC_ENABLE_STATUS_t IC_ENABLE_STATUS;
6456 IC_FS_SPKLEN_t IC_FS_SPKLEN;
6457 uint32_t reserved2;
6458 IC_CLR_RESTART_DET_t IC_CLR_RESTART_DET;
6459 uint32_t reserved3[18];
6460 IC_COMP_PARAM_1_t IC_COMP_PARAM_1;
6461 IC_COMP_VERSION_t IC_COMP_VERSION;
6462 IC_COMP_TYPE_t IC_COMP_TYPE;
6463 };
6464
6465 static I2C0_t & I2C0 = (*(I2C0_t *)0x40044000);
6466 static I2C0_t & I2C0_XOR = (*(I2C0_t *)0x40045000);
6467 static I2C0_t & I2C0_SET = (*(I2C0_t *)0x40046000);
6468 static I2C0_t & I2C0_CLR = (*(I2C0_t *)0x40047000);
6469
6470} // _I2C0_
6471
6472namespace _I2C1_ {
6473
6474 static _I2C0_::I2C0_t & I2C1 = (*(_I2C0_::I2C0_t *)0x40048000);
6475 static _I2C0_::I2C0_t & I2C1_XOR = (*(_I2C0_::I2C0_t *)0x40049000);
6476 static _I2C0_::I2C0_t & I2C1_SET = (*(_I2C0_::I2C0_t *)0x4004a000);
6477 static _I2C0_::I2C0_t & I2C1_CLR = (*(_I2C0_::I2C0_t *)0x4004b000);
6478
6479} // _I2C1_
6480
6481// Control and data interface to SAR ADC
6482namespace _ADC_ {
6483
6484 // ADC Control and Status
6485 // Reset value: 0x00000000
6486 BEGIN_TYPE(CS_t, uint32_t)
6487 // Round-robin sampling. 1 bit per channel. Set all bits to 0 to disable.
6488 // Otherwise, the ADC will cycle through each enabled channel in a round-robin fashion.
6489 // The first channel to be sampled will be the one currently indicated by AINSEL.
6490 // AINSEL will be updated after each conversion with the newly-selected channel.
6491 ADD_BITFIELD_RW(RROBIN, 16, 5)
6492 // Select analog mux input. Updated automatically in round-robin mode.
6493 ADD_BITFIELD_RW(AINSEL, 12, 3)
6494 // Some past ADC conversion encountered an error. Write 1 to clear.
6495 ADD_BITFIELD_RW(ERR_STICKY, 10, 1)
6496 // The most recent ADC conversion encountered an error; result is undefined or noisy.
6497 ADD_BITFIELD_RO(ERR, 9, 1)
6498 // 1 if the ADC is ready to start a new conversion. Implies any previous conversion has completed.
6499 // 0 whilst conversion in progress.
6500 ADD_BITFIELD_RO(READY, 8, 1)
6501 // Continuously perform conversions whilst this bit is 1. A new conversion will start immediately after the previous finishes.
6502 ADD_BITFIELD_RW(START_MANY, 3, 1)
6503 // Start a single conversion. Self-clearing. Ignored if start_many is asserted.
6504 ADD_BITFIELD_RW(START_ONCE, 2, 1)
6505 // Power on temperature sensor. 1 - enabled. 0 - disabled.
6506 ADD_BITFIELD_RW(TS_EN, 1, 1)
6507 // Power on ADC and enable its clock.
6508 // 1 - enabled. 0 - disabled.
6509 ADD_BITFIELD_RW(EN, 0, 1)
6510 END_TYPE()
6511
6512 // Result of most recent ADC conversion
6513 // Reset value: 0x00000000
6514 BEGIN_TYPE(RESULT_t, uint32_t)
6515 ADD_BITFIELD_RO(RESULT, 0, 12)
6516 END_TYPE()
6517
6518 // FIFO control and status
6519 // Reset value: 0x00000000
6520 BEGIN_TYPE(FCS_t, uint32_t)
6521 // DREQ/IRQ asserted when level >= threshold
6522 ADD_BITFIELD_RW(THRESH, 24, 4)
6523 // The number of conversion results currently waiting in the FIFO
6524 ADD_BITFIELD_RO(LEVEL, 16, 4)
6525 // 1 if the FIFO has been overflowed. Write 1 to clear.
6526 ADD_BITFIELD_RW(OVER, 11, 1)
6527 // 1 if the FIFO has been underflowed. Write 1 to clear.
6528 ADD_BITFIELD_RW(UNDER, 10, 1)
6529 ADD_BITFIELD_RO(FULL, 9, 1)
6530 ADD_BITFIELD_RO(EMPTY, 8, 1)
6531 // If 1: assert DMA requests when FIFO contains data
6532 ADD_BITFIELD_RW(DREQ_EN, 3, 1)
6533 // If 1: conversion error bit appears in the FIFO alongside the result
6534 ADD_BITFIELD_RW(ERR, 2, 1)
6535 // If 1: FIFO results are right-shifted to be one byte in size. Enables DMA to byte buffers.
6536 ADD_BITFIELD_RW(SHIFT, 1, 1)
6537 // If 1: write result to the FIFO after each conversion.
6538 ADD_BITFIELD_RW(EN, 0, 1)
6539 END_TYPE()
6540
6541 // Conversion result FIFO
6542 // Reset value: 0x00000000
6543 BEGIN_TYPE(FIFO_t, uint32_t)
6544 // 1 if this particular sample experienced a conversion error. Remains in the same location if the sample is shifted.
6545 ADD_BITFIELD_RO(ERR, 15, 1)
6546 ADD_BITFIELD_RO(VAL, 0, 12)
6547 END_TYPE()
6548
6549 // Clock divider. If non-zero, CS_START_MANY will start conversions
6550 // at regular intervals rather than back-to-back.
6551 // The divider is reset when either of these fields are written.
6552 // Total period is 1 + INT + FRAC / 256
6553 // Reset value: 0x00000000
6554 BEGIN_TYPE(DIV_t, uint32_t)
6555 // Integer part of clock divisor.
6556 ADD_BITFIELD_RW(INT, 8, 16)
6557 // Fractional part of clock divisor. First-order delta-sigma.
6558 ADD_BITFIELD_RW(FRAC, 0, 8)
6559 END_TYPE()
6560
6561 // Raw Interrupts
6562 // Reset value: 0x00000000
6563 BEGIN_TYPE(INTR_t, uint32_t)
6564 // Triggered when the sample FIFO reaches a certain level.
6565 // This level can be programmed via the FCS_THRESH field.
6566 ADD_BITFIELD_RO(FIFO, 0, 1)
6567 END_TYPE()
6568
6569 // Interrupt Enable
6570 // Reset value: 0x00000000
6571 BEGIN_TYPE(INTE_t, uint32_t)
6572 // Triggered when the sample FIFO reaches a certain level.
6573 // This level can be programmed via the FCS_THRESH field.
6574 ADD_BITFIELD_RW(FIFO, 0, 1)
6575 END_TYPE()
6576
6577 // Interrupt Force
6578 // Reset value: 0x00000000
6579 BEGIN_TYPE(INTF_t, uint32_t)
6580 // Triggered when the sample FIFO reaches a certain level.
6581 // This level can be programmed via the FCS_THRESH field.
6582 ADD_BITFIELD_RW(FIFO, 0, 1)
6583 END_TYPE()
6584
6585 // Interrupt status after masking & forcing
6586 // Reset value: 0x00000000
6587 BEGIN_TYPE(INTS_t, uint32_t)
6588 // Triggered when the sample FIFO reaches a certain level.
6589 // This level can be programmed via the FCS_THRESH field.
6590 ADD_BITFIELD_RO(FIFO, 0, 1)
6591 END_TYPE()
6592
6593 struct ADC_t {
6594 CS_t CS;
6595 RESULT_t RESULT;
6596 FCS_t FCS;
6597 FIFO_t FIFO;
6598 DIV_t DIV;
6599 INTR_t INTR;
6600 INTE_t INTE;
6601 INTF_t INTF;
6602 INTS_t INTS;
6603 };
6604
6605 static ADC_t & ADC = (*(ADC_t *)0x4004c000);
6606 static ADC_t & ADC_XOR = (*(ADC_t *)0x4004d000);
6607 static ADC_t & ADC_SET = (*(ADC_t *)0x4004e000);
6608 static ADC_t & ADC_CLR = (*(ADC_t *)0x4004f000);
6609
6610} // _ADC_
6611
6612// Simple PWM
6613namespace _PWM_ {
6614
6615 // Control and status register
6616 // Reset value: 0x00000000
6617 BEGIN_TYPE(CH_CSR_t, uint32_t)
6618 // Advance the phase of the counter by 1 count, while it is running.
6619 // Self-clearing. Write a 1, and poll until low. Counter must be running
6620 // at less than full speed (div_int + div_frac / 16 > 1)
6621 ADD_BITFIELD_RW(PH_ADV, 7, 1)
6622 // Retard the phase of the counter by 1 count, while it is running.
6623 // Self-clearing. Write a 1, and poll until low. Counter must be running.
6624 ADD_BITFIELD_RW(PH_RET, 6, 1)
6625 ADD_BITFIELD_RW(DIVMODE, 4, 2)
6626 // Invert output B
6627 ADD_BITFIELD_RW(B_INV, 3, 1)
6628 // Invert output A
6629 ADD_BITFIELD_RW(A_INV, 2, 1)
6630 // 1: Enable phase-correct modulation. 0: Trailing-edge
6631 ADD_BITFIELD_RW(PH_CORRECT, 1, 1)
6632 // Enable the PWM channel.
6633 ADD_BITFIELD_RW(EN, 0, 1)
6634 END_TYPE()
6635
6636 // Free-running counting at rate dictated by fractional divider
6637 static const uint32_t CH_CSR_DIVMODE__div = 0;
6638 // Fractional divider operation is gated by the PWM B pin.
6639 static const uint32_t CH_CSR_DIVMODE__level = 1;
6640 // Counter advances with each rising edge of the PWM B pin.
6641 static const uint32_t CH_CSR_DIVMODE__rise = 2;
6642 // Counter advances with each falling edge of the PWM B pin.
6643 static const uint32_t CH_CSR_DIVMODE__fall = 3;
6644
6645 // INT and FRAC form a fixed-point fractional number.
6646 // Counting rate is system clock frequency divided by this number.
6647 // Fractional division uses simple 1st-order sigma-delta.
6648 // Reset value: 0x00000010
6649 BEGIN_TYPE(CH_DIV_t, uint32_t)
6650 ADD_BITFIELD_RW(INT, 4, 8)
6651 ADD_BITFIELD_RW(FRAC, 0, 4)
6652 END_TYPE()
6653
6654 // Direct access to the PWM counter
6655 // Reset value: 0x00000000
6656 BEGIN_TYPE(CH_CTR_t, uint32_t)
6657 ADD_BITFIELD_RW(CTR, 0, 16)
6658 END_TYPE()
6659
6660 // Counter compare values
6661 // Reset value: 0x00000000
6662 BEGIN_TYPE(CH_CC_t, uint32_t)
6663 ADD_BITFIELD_RW(B, 16, 16)
6664 ADD_BITFIELD_RW(A, 0, 16)
6665 END_TYPE()
6666
6667 // Counter wrap value
6668 // Reset value: 0x0000ffff
6669 BEGIN_TYPE(CH_TOP_t, uint32_t)
6670 ADD_BITFIELD_RW(TOP, 0, 16)
6671 END_TYPE()
6672
6673 // This register aliases the CSR_EN bits for all channels.
6674 // Writing to this register allows multiple channels to be enabled
6675 // or disabled simultaneously, so they can run in perfect sync.
6676 // For each channel, there is only one physical EN register bit,
6677 // which can be accessed through here or CHx_CSR.
6678 // Reset value: 0x00000000
6679 BEGIN_TYPE(EN_t, uint32_t)
6680 ADD_BITFIELD_RW(CH7, 7, 1)
6681 ADD_BITFIELD_RW(CH6, 6, 1)
6682 ADD_BITFIELD_RW(CH5, 5, 1)
6683 ADD_BITFIELD_RW(CH4, 4, 1)
6684 ADD_BITFIELD_RW(CH3, 3, 1)
6685 ADD_BITFIELD_RW(CH2, 2, 1)
6686 ADD_BITFIELD_RW(CH1, 1, 1)
6687 ADD_BITFIELD_RW(CH0, 0, 1)
6688 END_TYPE()
6689
6690 // Raw Interrupts
6691 // Reset value: 0x00000000
6692 BEGIN_TYPE(INTR_t, uint32_t)
6693 ADD_BITFIELD_RW(CH7, 7, 1)
6694 ADD_BITFIELD_RW(CH6, 6, 1)
6695 ADD_BITFIELD_RW(CH5, 5, 1)
6696 ADD_BITFIELD_RW(CH4, 4, 1)
6697 ADD_BITFIELD_RW(CH3, 3, 1)
6698 ADD_BITFIELD_RW(CH2, 2, 1)
6699 ADD_BITFIELD_RW(CH1, 1, 1)
6700 ADD_BITFIELD_RW(CH0, 0, 1)
6701 END_TYPE()
6702
6703 // Interrupt Enable
6704 // Reset value: 0x00000000
6705 BEGIN_TYPE(INTE_t, uint32_t)
6706 ADD_BITFIELD_RW(CH7, 7, 1)
6707 ADD_BITFIELD_RW(CH6, 6, 1)
6708 ADD_BITFIELD_RW(CH5, 5, 1)
6709 ADD_BITFIELD_RW(CH4, 4, 1)
6710 ADD_BITFIELD_RW(CH3, 3, 1)
6711 ADD_BITFIELD_RW(CH2, 2, 1)
6712 ADD_BITFIELD_RW(CH1, 1, 1)
6713 ADD_BITFIELD_RW(CH0, 0, 1)
6714 END_TYPE()
6715
6716 // Interrupt Force
6717 // Reset value: 0x00000000
6718 BEGIN_TYPE(INTF_t, uint32_t)
6719 ADD_BITFIELD_RW(CH7, 7, 1)
6720 ADD_BITFIELD_RW(CH6, 6, 1)
6721 ADD_BITFIELD_RW(CH5, 5, 1)
6722 ADD_BITFIELD_RW(CH4, 4, 1)
6723 ADD_BITFIELD_RW(CH3, 3, 1)
6724 ADD_BITFIELD_RW(CH2, 2, 1)
6725 ADD_BITFIELD_RW(CH1, 1, 1)
6726 ADD_BITFIELD_RW(CH0, 0, 1)
6727 END_TYPE()
6728
6729 // Interrupt status after masking & forcing
6730 // Reset value: 0x00000000
6731 BEGIN_TYPE(INTS_t, uint32_t)
6732 ADD_BITFIELD_RO(CH7, 7, 1)
6733 ADD_BITFIELD_RO(CH6, 6, 1)
6734 ADD_BITFIELD_RO(CH5, 5, 1)
6735 ADD_BITFIELD_RO(CH4, 4, 1)
6736 ADD_BITFIELD_RO(CH3, 3, 1)
6737 ADD_BITFIELD_RO(CH2, 2, 1)
6738 ADD_BITFIELD_RO(CH1, 1, 1)
6739 ADD_BITFIELD_RO(CH0, 0, 1)
6740 END_TYPE()
6741
6742 struct PWM_t {
6743 CH_CSR_t CH0_CSR;
6744 CH_DIV_t CH0_DIV;
6745 CH_CTR_t CH0_CTR;
6746 CH_CC_t CH0_CC;
6747 CH_TOP_t CH0_TOP;
6748 CH_CSR_t CH1_CSR;
6749 CH_DIV_t CH1_DIV;
6750 CH_CTR_t CH1_CTR;
6751 CH_CC_t CH1_CC;
6752 CH_TOP_t CH1_TOP;
6753 CH_CSR_t CH2_CSR;
6754 CH_DIV_t CH2_DIV;
6755 CH_CTR_t CH2_CTR;
6756 CH_CC_t CH2_CC;
6757 CH_TOP_t CH2_TOP;
6758 CH_CSR_t CH3_CSR;
6759 CH_DIV_t CH3_DIV;
6760 CH_CTR_t CH3_CTR;
6761 CH_CC_t CH3_CC;
6762 CH_TOP_t CH3_TOP;
6763 CH_CSR_t CH4_CSR;
6764 CH_DIV_t CH4_DIV;
6765 CH_CTR_t CH4_CTR;
6766 CH_CC_t CH4_CC;
6767 CH_TOP_t CH4_TOP;
6768 CH_CSR_t CH5_CSR;
6769 CH_DIV_t CH5_DIV;
6770 CH_CTR_t CH5_CTR;
6771 CH_CC_t CH5_CC;
6772 CH_TOP_t CH5_TOP;
6773 CH_CSR_t CH6_CSR;
6774 CH_DIV_t CH6_DIV;
6775 CH_CTR_t CH6_CTR;
6776 CH_CC_t CH6_CC;
6777 CH_TOP_t CH6_TOP;
6778 CH_CSR_t CH7_CSR;
6779 CH_DIV_t CH7_DIV;
6780 CH_CTR_t CH7_CTR;
6781 CH_CC_t CH7_CC;
6782 CH_TOP_t CH7_TOP;
6783 EN_t EN;
6784 INTR_t INTR;
6785 INTE_t INTE;
6786 INTF_t INTF;
6787 INTS_t INTS;
6788 };
6789
6790 static PWM_t & PWM = (*(PWM_t *)0x40050000);
6791 static PWM_t & PWM_XOR = (*(PWM_t *)0x40051000);
6792 static PWM_t & PWM_SET = (*(PWM_t *)0x40052000);
6793 static PWM_t & PWM_CLR = (*(PWM_t *)0x40053000);
6794
6795} // _PWM_
6796
6797// Controls time and alarms
6798// time is a 64 bit value indicating the time in usec since power-on
6799// timeh is the top 32 bits of time & timel is the bottom 32 bits
6800// to change time write to timelw before timehw
6801// to read time read from timelr before timehr
6802// An alarm is set by setting alarm_enable and writing to the corresponding alarm register
6803// When an alarm is pending, the corresponding alarm_running signal will be high
6804// An alarm can be cancelled before it has finished by clearing the alarm_enable
6805// When an alarm fires, the corresponding alarm_irq is set and alarm_running is cleared
6806// To clear the interrupt write a 1 to the corresponding alarm_irq
6807namespace _TIMER_ {
6808
6809 // Write to bits 63:32 of time
6810 // always write timelw before timehw
6811 // Reset value: 0x00000000
6812 typedef uint32_t TIMEHW_t;
6813
6814 // Write to bits 31:0 of time
6815 // writes do not get copied to time until timehw is written
6816 // Reset value: 0x00000000
6817 typedef uint32_t TIMELW_t;
6818
6819 // Read from bits 63:32 of time
6820 // always read timelr before timehr
6821 // Reset value: 0x00000000
6822 typedef uint32_t TIMEHR_t;
6823
6824 // Read from bits 31:0 of time
6825 // Reset value: 0x00000000
6826 typedef uint32_t TIMELR_t;
6827
6828 // Arm alarm 0, and configure the time it will fire.
6829 // Once armed, the alarm fires when TIMER_ALARM0 == TIMELR.
6830 // The alarm will disarm itself once it fires, and can
6831 // be disarmed early using the ARMED status register.
6832 // Reset value: 0x00000000
6833 typedef uint32_t ALARM0_t;
6834
6835 // Arm alarm 1, and configure the time it will fire.
6836 // Once armed, the alarm fires when TIMER_ALARM1 == TIMELR.
6837 // The alarm will disarm itself once it fires, and can
6838 // be disarmed early using the ARMED status register.
6839 // Reset value: 0x00000000
6840 typedef uint32_t ALARM1_t;
6841
6842 // Arm alarm 2, and configure the time it will fire.
6843 // Once armed, the alarm fires when TIMER_ALARM2 == TIMELR.
6844 // The alarm will disarm itself once it fires, and can
6845 // be disarmed early using the ARMED status register.
6846 // Reset value: 0x00000000
6847 typedef uint32_t ALARM2_t;
6848
6849 // Arm alarm 3, and configure the time it will fire.
6850 // Once armed, the alarm fires when TIMER_ALARM3 == TIMELR.
6851 // The alarm will disarm itself once it fires, and can
6852 // be disarmed early using the ARMED status register.
6853 // Reset value: 0x00000000
6854 typedef uint32_t ALARM3_t;
6855
6856 // Indicates the armed/disarmed status of each alarm.
6857 // A write to the corresponding ALARMx register arms the alarm.
6858 // Alarms automatically disarm upon firing, but writing ones here
6859 // will disarm immediately without waiting to fire.
6860 // Reset value: 0x00000000
6861 BEGIN_TYPE(ARMED_t, uint32_t)
6862 ADD_BITFIELD_RW(ARMED, 0, 4)
6863 END_TYPE()
6864
6865 // Raw read from bits 63:32 of time (no side effects)
6866 // Reset value: 0x00000000
6867 typedef uint32_t TIMERAWH_t;
6868
6869 // Raw read from bits 31:0 of time (no side effects)
6870 // Reset value: 0x00000000
6871 typedef uint32_t TIMERAWL_t;
6872
6873 // Set bits high to enable pause when the corresponding debug ports are active
6874 // Reset value: 0x00000007
6875 BEGIN_TYPE(DBGPAUSE_t, uint32_t)
6876 // Pause when processor 1 is in debug mode
6877 ADD_BITFIELD_RW(DBG1, 2, 1)
6878 // Pause when processor 0 is in debug mode
6879 ADD_BITFIELD_RW(DBG0, 1, 1)
6880 END_TYPE()
6881
6882 // Set high to pause the timer
6883 // Reset value: 0x00000000
6884 BEGIN_TYPE(PAUSE_t, uint32_t)
6885 ADD_BITFIELD_RW(PAUSE, 0, 1)
6886 END_TYPE()
6887
6888 // Raw Interrupts
6889 // Reset value: 0x00000000
6890 BEGIN_TYPE(INTR_t, uint32_t)
6891 ADD_BITFIELD_RW(ALARM_3, 3, 1)
6892 ADD_BITFIELD_RW(ALARM_2, 2, 1)
6893 ADD_BITFIELD_RW(ALARM_1, 1, 1)
6894 ADD_BITFIELD_RW(ALARM_0, 0, 1)
6895 END_TYPE()
6896
6897 // Interrupt Enable
6898 // Reset value: 0x00000000
6899 BEGIN_TYPE(INTE_t, uint32_t)
6900 ADD_BITFIELD_RW(ALARM_3, 3, 1)
6901 ADD_BITFIELD_RW(ALARM_2, 2, 1)
6902 ADD_BITFIELD_RW(ALARM_1, 1, 1)
6903 ADD_BITFIELD_RW(ALARM_0, 0, 1)
6904 END_TYPE()
6905
6906 // Interrupt Force
6907 // Reset value: 0x00000000
6908 BEGIN_TYPE(INTF_t, uint32_t)
6909 ADD_BITFIELD_RW(ALARM_3, 3, 1)
6910 ADD_BITFIELD_RW(ALARM_2, 2, 1)
6911 ADD_BITFIELD_RW(ALARM_1, 1, 1)
6912 ADD_BITFIELD_RW(ALARM_0, 0, 1)
6913 END_TYPE()
6914
6915 // Interrupt status after masking & forcing
6916 // Reset value: 0x00000000
6917 BEGIN_TYPE(INTS_t, uint32_t)
6918 ADD_BITFIELD_RO(ALARM_3, 3, 1)
6919 ADD_BITFIELD_RO(ALARM_2, 2, 1)
6920 ADD_BITFIELD_RO(ALARM_1, 1, 1)
6921 ADD_BITFIELD_RO(ALARM_0, 0, 1)
6922 END_TYPE()
6923
6924 struct TIMER_t {
6925 TIMEHW_t TIMEHW;
6926 TIMELW_t TIMELW;
6927 TIMEHR_t TIMEHR;
6928 TIMELR_t TIMELR;
6929 ALARM0_t ALARM0;
6930 ALARM1_t ALARM1;
6931 ALARM2_t ALARM2;
6932 ALARM3_t ALARM3;
6933 ARMED_t ARMED;
6934 TIMERAWH_t TIMERAWH;
6935 TIMERAWL_t TIMERAWL;
6936 DBGPAUSE_t DBGPAUSE;
6937 PAUSE_t PAUSE;
6938 INTR_t INTR;
6939 INTE_t INTE;
6940 INTF_t INTF;
6941 INTS_t INTS;
6942 };
6943
6944 static TIMER_t & TIMER = (*(TIMER_t *)0x40054000);
6945 static TIMER_t & TIMER_XOR = (*(TIMER_t *)0x40055000);
6946 static TIMER_t & TIMER_SET = (*(TIMER_t *)0x40056000);
6947 static TIMER_t & TIMER_CLR = (*(TIMER_t *)0x40057000);
6948
6949} // _TIMER_
6950
6951namespace _WATCHDOG_ {
6952
6953 // Watchdog control
6954 // The rst_wdsel register determines which subsystems are reset when the watchdog is triggered.
6955 // The watchdog can be triggered in software.
6956 // Reset value: 0x07000000
6957 BEGIN_TYPE(CTRL_t, uint32_t)
6958 // Trigger a watchdog reset
6959 ADD_BITFIELD_RW(TRIGGER, 31, 1)
6960 // When not enabled the watchdog timer is paused
6961 ADD_BITFIELD_RW(ENABLE, 30, 1)
6962 // Pause the watchdog timer when processor 1 is in debug mode
6963 ADD_BITFIELD_RW(PAUSE_DBG1, 26, 1)
6964 // Pause the watchdog timer when processor 0 is in debug mode
6965 ADD_BITFIELD_RW(PAUSE_DBG0, 25, 1)
6966 // Pause the watchdog timer when JTAG is accessing the bus fabric
6967 ADD_BITFIELD_RW(PAUSE_JTAG, 24, 1)
6968 // Indicates the number of ticks / 2 (see errata RP2040-E1) before a watchdog reset will be triggered
6969 ADD_BITFIELD_RO(TIME, 0, 24)
6970 END_TYPE()
6971
6972 // Load the watchdog timer. The maximum setting is 0xffffff which corresponds to 0xffffff / 2 ticks before triggering a watchdog reset (see errata RP2040-E1).
6973 // Reset value: 0x00000000
6974 BEGIN_TYPE(LOAD_t, uint32_t)
6975 ADD_BITFIELD_WO(LOAD, 0, 24)
6976 END_TYPE()
6977
6978 // Logs the reason for the last reset. Both bits are zero for the case of a hardware reset.
6979 // Reset value: 0x00000000
6980 BEGIN_TYPE(REASON_t, uint32_t)
6981 ADD_BITFIELD_RO(FORCE, 1, 1)
6982 ADD_BITFIELD_RO(TIMER, 0, 1)
6983 END_TYPE()
6984
6985 // Scratch register. Information persists through soft reset of the chip.
6986 // Reset value: 0x00000000
6987 typedef uint32_t SCRATCH_t;
6988
6989 // Controls the tick generator
6990 // Reset value: 0x00000200
6991 BEGIN_TYPE(TICK_t, uint32_t)
6992 // Count down timer: the remaining number clk_tick cycles before the next tick is generated.
6993 ADD_BITFIELD_RO(COUNT, 11, 9)
6994 // Is the tick generator running?
6995 ADD_BITFIELD_RO(RUNNING, 10, 1)
6996 // start / stop tick generation
6997 ADD_BITFIELD_RW(ENABLE, 9, 1)
6998 // Total number of clk_tick cycles before the next tick.
6999 ADD_BITFIELD_RW(CYCLES, 0, 9)
7000 END_TYPE()
7001
7002 struct WATCHDOG_t {
7003 CTRL_t CTRL;
7004 LOAD_t LOAD;
7005 REASON_t REASON;
7006 SCRATCH_t SCRATCH[8];
7007 TICK_t TICK;
7008 };
7009
7010 static WATCHDOG_t & WATCHDOG = (*(WATCHDOG_t *)0x40058000);
7011 static WATCHDOG_t & WATCHDOG_XOR = (*(WATCHDOG_t *)0x40059000);
7012 static WATCHDOG_t & WATCHDOG_SET = (*(WATCHDOG_t *)0x4005a000);
7013 static WATCHDOG_t & WATCHDOG_CLR = (*(WATCHDOG_t *)0x4005b000);
7014
7015} // _WATCHDOG_
7016
7017// Register block to control RTC
7018namespace _RTC_ {
7019
7020 // Divider minus 1 for the 1 second counter. Safe to change the value when RTC is not enabled.
7021 // Reset value: 0x00000000
7022 BEGIN_TYPE(CLKDIV_M1_t, uint32_t)
7023 ADD_BITFIELD_RW(CLKDIV_M1, 0, 16)
7024 END_TYPE()
7025
7026 // RTC setup register 0
7027 // Reset value: 0x00000000
7028 BEGIN_TYPE(SETUP_0_t, uint32_t)
7029 // Year
7030 ADD_BITFIELD_RW(YEAR, 12, 12)
7031 // Month (1..12)
7032 ADD_BITFIELD_RW(MONTH, 8, 4)
7033 // Day of the month (1..31)
7034 ADD_BITFIELD_RW(DAY, 0, 5)
7035 END_TYPE()
7036
7037 // RTC setup register 1
7038 // Reset value: 0x00000000
7039 BEGIN_TYPE(SETUP_1_t, uint32_t)
7040 // Day of the week: 1-Monday...0-Sunday ISO 8601 mod 7
7041 ADD_BITFIELD_RW(DOTW, 24, 3)
7042 // Hours
7043 ADD_BITFIELD_RW(HOUR, 16, 5)
7044 // Minutes
7045 ADD_BITFIELD_RW(MIN, 8, 6)
7046 // Seconds
7047 ADD_BITFIELD_RW(SEC, 0, 6)
7048 END_TYPE()
7049
7050 // RTC Control and status
7051 // Reset value: 0x00000000
7052 BEGIN_TYPE(CTRL_t, uint32_t)
7053 // If set, leapyear is forced off.
7054 // Useful for years divisible by 100 but not by 400
7055 ADD_BITFIELD_RW(FORCE_NOTLEAPYEAR, 8, 1)
7056 // Load RTC
7057 ADD_BITFIELD_RW(LOAD, 4, 1)
7058 // RTC enabled (running)
7059 ADD_BITFIELD_RO(RTC_ACTIVE, 1, 1)
7060 // Enable RTC
7061 ADD_BITFIELD_RW(RTC_ENABLE, 0, 1)
7062 END_TYPE()
7063
7064 // Interrupt setup register 0
7065 // Reset value: 0x00000000
7066 BEGIN_TYPE(IRQ_SETUP_0_t, uint32_t)
7067 ADD_BITFIELD_RO(MATCH_ACTIVE, 29, 1)
7068 // Global match enable. Don't change any other value while this one is enabled
7069 ADD_BITFIELD_RW(MATCH_ENA, 28, 1)
7070 // Enable year matching
7071 ADD_BITFIELD_RW(YEAR_ENA, 26, 1)
7072 // Enable month matching
7073 ADD_BITFIELD_RW(MONTH_ENA, 25, 1)
7074 // Enable day matching
7075 ADD_BITFIELD_RW(DAY_ENA, 24, 1)
7076 // Year
7077 ADD_BITFIELD_RW(YEAR, 12, 12)
7078 // Month (1..12)
7079 ADD_BITFIELD_RW(MONTH, 8, 4)
7080 // Day of the month (1..31)
7081 ADD_BITFIELD_RW(DAY, 0, 5)
7082 END_TYPE()
7083
7084 // Interrupt setup register 1
7085 // Reset value: 0x00000000
7086 BEGIN_TYPE(IRQ_SETUP_1_t, uint32_t)
7087 // Enable day of the week matching
7088 ADD_BITFIELD_RW(DOTW_ENA, 31, 1)
7089 // Enable hour matching
7090 ADD_BITFIELD_RW(HOUR_ENA, 30, 1)
7091 // Enable minute matching
7092 ADD_BITFIELD_RW(MIN_ENA, 29, 1)
7093 // Enable second matching
7094 ADD_BITFIELD_RW(SEC_ENA, 28, 1)
7095 // Day of the week
7096 ADD_BITFIELD_RW(DOTW, 24, 3)
7097 // Hours
7098 ADD_BITFIELD_RW(HOUR, 16, 5)
7099 // Minutes
7100 ADD_BITFIELD_RW(MIN, 8, 6)
7101 // Seconds
7102 ADD_BITFIELD_RW(SEC, 0, 6)
7103 END_TYPE()
7104
7105 // RTC register 1.
7106 // Reset value: 0x00000000
7107 BEGIN_TYPE(RTC_1_t, uint32_t)
7108 // Year
7109 ADD_BITFIELD_RO(YEAR, 12, 12)
7110 // Month (1..12)
7111 ADD_BITFIELD_RO(MONTH, 8, 4)
7112 // Day of the month (1..31)
7113 ADD_BITFIELD_RO(DAY, 0, 5)
7114 END_TYPE()
7115
7116 // RTC register 0
7117 // Read this before RTC 1!
7118 // Reset value: 0x00000000
7119 BEGIN_TYPE(RTC_0_t, uint32_t)
7120 // Day of the week
7121 ADD_BITFIELD_RO(DOTW, 24, 3)
7122 // Hours
7123 ADD_BITFIELD_RO(HOUR, 16, 5)
7124 // Minutes
7125 ADD_BITFIELD_RO(MIN, 8, 6)
7126 // Seconds
7127 ADD_BITFIELD_RO(SEC, 0, 6)
7128 END_TYPE()
7129
7130 // Raw Interrupts
7131 // Reset value: 0x00000000
7132 BEGIN_TYPE(INTR_t, uint32_t)
7133 ADD_BITFIELD_RO(RTC, 0, 1)
7134 END_TYPE()
7135
7136 // Interrupt Enable
7137 // Reset value: 0x00000000
7138 BEGIN_TYPE(INTE_t, uint32_t)
7139 ADD_BITFIELD_RW(RTC, 0, 1)
7140 END_TYPE()
7141
7142 // Interrupt Force
7143 // Reset value: 0x00000000
7144 BEGIN_TYPE(INTF_t, uint32_t)
7145 ADD_BITFIELD_RW(RTC, 0, 1)
7146 END_TYPE()
7147
7148 // Interrupt status after masking & forcing
7149 // Reset value: 0x00000000
7150 BEGIN_TYPE(INTS_t, uint32_t)
7151 ADD_BITFIELD_RO(RTC, 0, 1)
7152 END_TYPE()
7153
7154 struct RTC_t {
7155 CLKDIV_M1_t CLKDIV_M1;
7156 SETUP_0_t SETUP_0;
7157 SETUP_1_t SETUP_1;
7158 CTRL_t CTRL;
7159 IRQ_SETUP_0_t IRQ_SETUP_0;
7160 IRQ_SETUP_1_t IRQ_SETUP_1;
7161 RTC_1_t RTC_1;
7162 RTC_0_t RTC_0;
7163 INTR_t INTR;
7164 INTE_t INTE;
7165 INTF_t INTF;
7166 INTS_t INTS;
7167 };
7168
7169 static RTC_t & RTC = (*(RTC_t *)0x4005c000);
7170 static RTC_t & RTC_XOR = (*(RTC_t *)0x4005d000);
7171 static RTC_t & RTC_SET = (*(RTC_t *)0x4005e000);
7172 static RTC_t & RTC_CLR = (*(RTC_t *)0x4005f000);
7173
7174} // _RTC_
7175
7176namespace _ROSC_ {
7177
7178 // Ring Oscillator control
7179 // Reset value: 0x00000aa0
7180 BEGIN_TYPE(CTRL_t, uint32_t)
7181 // On power-up this field is initialised to ENABLE
7182 // The system clock must be switched to another source before setting this field to DISABLE otherwise the chip will lock up
7183 // The 12-bit code is intended to give some protection against accidental writes. An invalid setting will enable the oscillator.
7184 ADD_BITFIELD_RW(ENABLE, 12, 12)
7185 // Controls the number of delay stages in the ROSC ring
7186 // LOW uses stages 0 to 7
7187 // MEDIUM uses stages 0 to 5
7188 // HIGH uses stages 0 to 3
7189 // TOOHIGH uses stages 0 to 1 and should not be used because its frequency exceeds design specifications
7190 // The clock output will not glitch when changing the range up one step at a time
7191 // The clock output will glitch when changing the range down
7192 // Note: the values here are gray coded which is why HIGH comes before TOOHIGH
7193 ADD_BITFIELD_RW(FREQ_RANGE, 0, 12)
7194 END_TYPE()
7195
7196 static const uint32_t CTRL_ENABLE__DISABLE = 3358;
7197 static const uint32_t CTRL_ENABLE__ENABLE = 4011;
7198 static const uint32_t CTRL_FREQ_RANGE__LOW = 4004;
7199 static const uint32_t CTRL_FREQ_RANGE__MEDIUM = 4005;
7200 static const uint32_t CTRL_FREQ_RANGE__HIGH = 4007;
7201 static const uint32_t CTRL_FREQ_RANGE__TOOHIGH = 4006;
7202
7203 // The FREQA & FREQB registers control the frequency by controlling the drive strength of each stage
7204 // The drive strength has 4 levels determined by the number of bits set
7205 // Increasing the number of bits set increases the drive strength and increases the oscillation frequency
7206 // 0 bits set is the default drive strength
7207 // 1 bit set doubles the drive strength
7208 // 2 bits set triples drive strength
7209 // 3 bits set quadruples drive strength
7210 // Reset value: 0x00000000
7211 BEGIN_TYPE(FREQA_t, uint32_t)
7212 // Set to 0x9696 to apply the settings
7213 // Any other value in this field will set all drive strengths to 0
7214 ADD_BITFIELD_RW(PASSWD, 16, 16)
7215 // Stage 3 drive strength
7216 ADD_BITFIELD_RW(DS3, 12, 3)
7217 // Stage 2 drive strength
7218 ADD_BITFIELD_RW(DS2, 8, 3)
7219 // Stage 1 drive strength
7220 ADD_BITFIELD_RW(DS1, 4, 3)
7221 // Stage 0 drive strength
7222 ADD_BITFIELD_RW(DS0, 0, 3)
7223 END_TYPE()
7224
7225 static const uint32_t FREQA_PASSWD__PASS = 38550;
7226
7227 // For a detailed description see freqa register
7228 // Reset value: 0x00000000
7229 BEGIN_TYPE(FREQB_t, uint32_t)
7230 // Set to 0x9696 to apply the settings
7231 // Any other value in this field will set all drive strengths to 0
7232 ADD_BITFIELD_RW(PASSWD, 16, 16)
7233 // Stage 7 drive strength
7234 ADD_BITFIELD_RW(DS7, 12, 3)
7235 // Stage 6 drive strength
7236 ADD_BITFIELD_RW(DS6, 8, 3)
7237 // Stage 5 drive strength
7238 ADD_BITFIELD_RW(DS5, 4, 3)
7239 // Stage 4 drive strength
7240 ADD_BITFIELD_RW(DS4, 0, 3)
7241 END_TYPE()
7242
7243 static const uint32_t FREQB_PASSWD__PASS = 38550;
7244
7245 // Ring Oscillator pause control
7246 // This is used to save power by pausing the ROSC
7247 // On power-up this field is initialised to WAKE
7248 // An invalid write will also select WAKE
7249 // Warning: setup the irq before selecting dormant mode
7250 // Reset value: 0x00000000
7251 typedef uint32_t DORMANT_t;
7252
7253 // Controls the output divider
7254 // Reset value: 0x00000000
7255 BEGIN_TYPE(DIV_t, uint32_t)
7256 // set to 0xaa0 + div where
7257 // div = 0 divides by 32
7258 // div = 1-31 divides by div
7259 // any other value sets div=31
7260 // this register resets to div=16
7261 ADD_BITFIELD_RW(DIV, 0, 12)
7262 END_TYPE()
7263
7264 static const uint32_t DIV_DIV__PASS = 2720;
7265
7266 // Controls the phase shifted output
7267 // Reset value: 0x00000008
7268 BEGIN_TYPE(PHASE_t, uint32_t)
7269 // set to 0xaa
7270 // any other value enables the output with shift=0
7271 ADD_BITFIELD_RW(PASSWD, 4, 8)
7272 // enable the phase-shifted output
7273 // this can be changed on-the-fly
7274 ADD_BITFIELD_RW(ENABLE, 3, 1)
7275 // invert the phase-shifted output
7276 // this is ignored when div=1
7277 ADD_BITFIELD_RW(FLIP, 2, 1)
7278 // phase shift the phase-shifted output by SHIFT input clocks
7279 // this can be changed on-the-fly
7280 // must be set to 0 before setting div=1
7281 ADD_BITFIELD_RW(SHIFT, 0, 2)
7282 END_TYPE()
7283
7284 // Ring Oscillator Status
7285 // Reset value: 0x00000000
7286 BEGIN_TYPE(STATUS_t, uint32_t)
7287 // Oscillator is running and stable
7288 ADD_BITFIELD_RO(STABLE, 31, 1)
7289 // An invalid value has been written to CTRL_ENABLE or CTRL_FREQ_RANGE or FREQA or FREQB or DIV or PHASE or DORMANT
7290 ADD_BITFIELD_RW(BADWRITE, 24, 1)
7291 // post-divider is running
7292 // this resets to 0 but transitions to 1 during chip startup
7293 ADD_BITFIELD_RO(DIV_RUNNING, 16, 1)
7294 // Oscillator is enabled but not necessarily running and stable
7295 // this resets to 0 but transitions to 1 during chip startup
7296 ADD_BITFIELD_RO(ENABLED, 12, 1)
7297 END_TYPE()
7298
7299 // This just reads the state of the oscillator output so randomness is compromised if the ring oscillator is stopped or run at a harmonic of the bus frequency
7300 // Reset value: 0x00000001
7301 BEGIN_TYPE(RANDOMBIT_t, uint32_t)
7302 ADD_BITFIELD_RO(RANDOMBIT, 0, 1)
7303 END_TYPE()
7304
7305 // A down counter running at the ROSC frequency which counts to zero and stops.
7306 // To start the counter write a non-zero value.
7307 // Can be used for short software pauses when setting up time sensitive hardware.
7308 // Reset value: 0x00000000
7309 BEGIN_TYPE(COUNT_t, uint32_t)
7310 ADD_BITFIELD_RW(COUNT, 0, 8)
7311 END_TYPE()
7312
7313 struct ROSC_t {
7314 CTRL_t CTRL;
7315 FREQA_t FREQA;
7316 FREQB_t FREQB;
7317 DORMANT_t DORMANT;
7318 DIV_t DIV;
7319 PHASE_t PHASE;
7320 STATUS_t STATUS;
7321 RANDOMBIT_t RANDOMBIT;
7322 COUNT_t COUNT;
7323 };
7324
7325 static ROSC_t & ROSC = (*(ROSC_t *)0x40060000);
7326 static ROSC_t & ROSC_XOR = (*(ROSC_t *)0x40061000);
7327 static ROSC_t & ROSC_SET = (*(ROSC_t *)0x40062000);
7328 static ROSC_t & ROSC_CLR = (*(ROSC_t *)0x40063000);
7329
7330} // _ROSC_
7331
7332// control and status for on-chip voltage regulator and chip level reset subsystem
7333namespace _VREG_AND_CHIP_RESET_ {
7334
7335 // Voltage regulator control and status
7336 // Reset value: 0x000000b1
7337 BEGIN_TYPE(VREG_t, uint32_t)
7338 // regulation status
7339 // 0=not in regulation, 1=in regulation
7340 ADD_BITFIELD_RO(ROK, 12, 1)
7341 // output voltage select
7342 // 0000 to 0101 - 0.80V
7343 // 0110 - 0.85V
7344 // 0111 - 0.90V
7345 // 1000 - 0.95V
7346 // 1001 - 1.00V
7347 // 1010 - 1.05V
7348 // 1011 - 1.10V (default)
7349 // 1100 - 1.15V
7350 // 1101 - 1.20V
7351 // 1110 - 1.25V
7352 // 1111 - 1.30V
7353 ADD_BITFIELD_RW(VSEL, 4, 4)
7354 // high impedance mode select
7355 // 0=not in high impedance mode, 1=in high impedance mode
7356 ADD_BITFIELD_RW(HIZ, 1, 1)
7357 // enable
7358 // 0=not enabled, 1=enabled
7359 ADD_BITFIELD_RW(EN, 0, 1)
7360 END_TYPE()
7361
7362 // brown-out detection control
7363 // Reset value: 0x00000091
7364 BEGIN_TYPE(BOD_t, uint32_t)
7365 // threshold select
7366 // 0000 - 0.473V
7367 // 0001 - 0.516V
7368 // 0010 - 0.559V
7369 // 0011 - 0.602V
7370 // 0100 - 0.645V
7371 // 0101 - 0.688V
7372 // 0110 - 0.731V
7373 // 0111 - 0.774V
7374 // 1000 - 0.817V
7375 // 1001 - 0.860V (default)
7376 // 1010 - 0.903V
7377 // 1011 - 0.946V
7378 // 1100 - 0.989V
7379 // 1101 - 1.032V
7380 // 1110 - 1.075V
7381 // 1111 - 1.118V
7382 ADD_BITFIELD_RW(VSEL, 4, 4)
7383 // enable
7384 // 0=not enabled, 1=enabled
7385 ADD_BITFIELD_RW(EN, 0, 1)
7386 END_TYPE()
7387
7388 // Chip reset control and status
7389 // Reset value: 0x00000000
7390 BEGIN_TYPE(CHIP_RESET_t, uint32_t)
7391 // This is set by psm_restart from the debugger.
7392 // Its purpose is to branch bootcode to a safe mode when the debugger has issued a psm_restart in order to recover from a boot lock-up.
7393 // In the safe mode the debugger can repair the boot code, clear this flag then reboot the processor.
7394 ADD_BITFIELD_RW(PSM_RESTART_FLAG, 24, 1)
7395 // Last reset was from the debug port
7396 ADD_BITFIELD_RO(HAD_PSM_RESTART, 20, 1)
7397 // Last reset was from the RUN pin
7398 ADD_BITFIELD_RO(HAD_RUN, 16, 1)
7399 // Last reset was from the power-on reset or brown-out detection blocks
7400 ADD_BITFIELD_RO(HAD_POR, 8, 1)
7401 END_TYPE()
7402
7404 VREG_t VREG;
7405 BOD_t BOD;
7406 CHIP_RESET_t CHIP_RESET;
7407 };
7408
7409 static VREG_AND_CHIP_RESET_t & VREG_AND_CHIP_RESET = (*(VREG_AND_CHIP_RESET_t *)0x40064000);
7410 static VREG_AND_CHIP_RESET_t & VREG_AND_CHIP_RESET_XOR = (*(VREG_AND_CHIP_RESET_t *)0x40065000);
7411 static VREG_AND_CHIP_RESET_t & VREG_AND_CHIP_RESET_SET = (*(VREG_AND_CHIP_RESET_t *)0x40066000);
7412 static VREG_AND_CHIP_RESET_t & VREG_AND_CHIP_RESET_CLR = (*(VREG_AND_CHIP_RESET_t *)0x40067000);
7413
7414} // _VREG_AND_CHIP_RESET_
7415
7416// Testbench manager. Allows the programmer to know what platform their software is running on.
7417namespace _TBMAN_ {
7418
7419 // Indicates the type of platform in use
7420 // Reset value: 0x00000005
7421 BEGIN_TYPE(PLATFORM_t, uint32_t)
7422 // Indicates the platform is an FPGA
7423 ADD_BITFIELD_RO(FPGA, 1, 1)
7424 // Indicates the platform is an ASIC
7425 ADD_BITFIELD_RO(ASIC, 0, 1)
7426 END_TYPE()
7427
7428 struct TBMAN_t {
7429 PLATFORM_t PLATFORM;
7430 };
7431
7432 static TBMAN_t & TBMAN = (*(TBMAN_t *)0x4006c000);
7433 static TBMAN_t & TBMAN_XOR = (*(TBMAN_t *)0x4006d000);
7434 static TBMAN_t & TBMAN_SET = (*(TBMAN_t *)0x4006e000);
7435 static TBMAN_t & TBMAN_CLR = (*(TBMAN_t *)0x4006f000);
7436
7437} // _TBMAN_
7438
7439// DMA with separate read and write masters
7440namespace _DMA_ {
7441
7442 // DMA Channel 0 Read Address pointer
7443 // This register updates automatically each time a read completes. The current value is the next address to be read by this channel.
7444 // Reset value: 0x00000000
7445 typedef uint32_t CH_READ_ADDR_t;
7446
7447 // DMA Channel 0 Write Address pointer
7448 // This register updates automatically each time a write completes. The current value is the next address to be written by this channel.
7449 // Reset value: 0x00000000
7450 typedef uint32_t CH_WRITE_ADDR_t;
7451
7452 // DMA Channel 0 Transfer Count
7453 // Program the number of bus transfers a channel will perform before halting. Note that, if transfers are larger than one byte in size, this is not equal to the number of bytes transferred (see CTRL_DATA_SIZE).
7454 //
7455 // When the channel is active, reading this register shows the number of transfers remaining, updating automatically each time a write transfer completes.
7456 //
7457 // Writing this register sets the RELOAD value for the transfer counter. Each time this channel is triggered, the RELOAD value is copied into the live transfer counter. The channel can be started multiple times, and will perform the same number of transfers each time, as programmed by most recent write.
7458 //
7459 // The RELOAD value can be observed at CHx_DBG_TCR. If TRANS_COUNT is used as a trigger, the written value is used immediately as the length of the new transfer sequence, as well as being written to RELOAD.
7460 // Reset value: 0x00000000
7461 typedef uint32_t CH_TRANS_COUNT_t;
7462
7463 // DMA Channel 0 Control and Status
7464 // Reset value: 0x00000000
7465 BEGIN_TYPE(CH_CTRL_TRIG_t, uint32_t)
7466 // Logical OR of the READ_ERROR and WRITE_ERROR flags. The channel halts when it encounters any bus error, and always raises its channel IRQ flag.
7467 ADD_BITFIELD_RO(AHB_ERROR, 31, 1)
7468 // If 1, the channel received a read bus error. Write one to clear.
7469 // READ_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 3 transfers later)
7470 ADD_BITFIELD_RW(READ_ERROR, 30, 1)
7471 // If 1, the channel received a write bus error. Write one to clear.
7472 // WRITE_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 5 transfers later)
7473 ADD_BITFIELD_RW(WRITE_ERROR, 29, 1)
7474 // This flag goes high when the channel starts a new transfer sequence, and low when the last transfer of that sequence completes. Clearing EN while BUSY is high pauses the channel, and BUSY will stay high while paused.
7475 //
7476 // To terminate a sequence early (and clear the BUSY flag), see CHAN_ABORT.
7477 ADD_BITFIELD_RO(BUSY, 24, 1)
7478 // If 1, this channel's data transfers are visible to the sniff hardware, and each transfer will advance the state of the checksum. This only applies if the sniff hardware is enabled, and has this channel selected.
7479 //
7480 // This allows checksum to be enabled or disabled on a per-control- block basis.
7481 ADD_BITFIELD_RW(SNIFF_EN, 23, 1)
7482 // Apply byte-swap transformation to DMA data.
7483 // For byte data, this has no effect. For halfword data, the two bytes of each halfword are swapped. For word data, the four bytes of each word are swapped to reverse order.
7484 ADD_BITFIELD_RW(BSWAP, 22, 1)
7485 // In QUIET mode, the channel does not generate IRQs at the end of every transfer block. Instead, an IRQ is raised when NULL is written to a trigger register, indicating the end of a control block chain.
7486 //
7487 // This reduces the number of interrupts to be serviced by the CPU when transferring a DMA chain of many small control blocks.
7488 ADD_BITFIELD_RW(IRQ_QUIET, 21, 1)
7489 // Select a Transfer Request signal.
7490 // The channel uses the transfer request signal to pace its data transfer rate. Sources for TREQ signals are internal (TIMERS) or external (DREQ, a Data Request from the system).
7491 // 0x0 to 0x3a -> select DREQ n as TREQ
7492 ADD_BITFIELD_RW(TREQ_SEL, 15, 6)
7493 // When this channel completes, it will trigger the channel indicated by CHAIN_TO. Disable by setting CHAIN_TO = _(this channel)_.
7494 ADD_BITFIELD_RW(CHAIN_TO, 11, 4)
7495 // Select whether RING_SIZE applies to read or write addresses.
7496 // If 0, read addresses are wrapped on a (1 << RING_SIZE) boundary. If 1, write addresses are wrapped.
7497 ADD_BITFIELD_RW(RING_SEL, 10, 1)
7498 // Size of address wrap region. If 0, don't wrap. For values n > 0, only the lower n bits of the address will change. This wraps the address on a (1 << n) byte boundary, facilitating access to naturally-aligned ring buffers.
7499 //
7500 // Ring sizes between 2 and 32768 bytes are possible. This can apply to either read or write addresses, based on value of RING_SEL.
7501 ADD_BITFIELD_RW(RING_SIZE, 6, 4)
7502 // If 1, the write address increments with each transfer. If 0, each write is directed to the same, initial address.
7503 //
7504 // Generally this should be disabled for memory-to-peripheral transfers.
7505 ADD_BITFIELD_RW(INCR_WRITE, 5, 1)
7506 // If 1, the read address increments with each transfer. If 0, each read is directed to the same, initial address.
7507 //
7508 // Generally this should be disabled for peripheral-to-memory transfers.
7509 ADD_BITFIELD_RW(INCR_READ, 4, 1)
7510 // Set the size of each bus transfer (byte/halfword/word). READ_ADDR and WRITE_ADDR advance by this amount (1/2/4 bytes) with each transfer.
7511 ADD_BITFIELD_RW(DATA_SIZE, 2, 2)
7512 // HIGH_PRIORITY gives a channel preferential treatment in issue scheduling: in each scheduling round, all high priority channels are considered first, and then only a single low priority channel, before returning to the high priority channels.
7513 //
7514 // This only affects the order in which the DMA schedules channels. The DMA's bus priority is not changed. If the DMA is not saturated then a low priority channel will see no loss of throughput.
7515 ADD_BITFIELD_RW(HIGH_PRIORITY, 1, 1)
7516 // DMA Channel Enable.
7517 // When 1, the channel will respond to triggering events, which will cause it to become BUSY and start transferring data. When 0, the channel will ignore triggers, stop issuing transfers, and pause the current transfer sequence (i.e. BUSY will remain high if already high)
7518 ADD_BITFIELD_RW(EN, 0, 1)
7519 END_TYPE()
7520
7521 // Select Timer 0 as TREQ
7522 static const uint32_t CH_CTRL_TRIG_TREQ_SEL__TIMER0 = 59;
7523 // Select Timer 1 as TREQ
7524 static const uint32_t CH_CTRL_TRIG_TREQ_SEL__TIMER1 = 60;
7525 // Select Timer 2 as TREQ (Optional)
7526 static const uint32_t CH_CTRL_TRIG_TREQ_SEL__TIMER2 = 61;
7527 // Select Timer 3 as TREQ (Optional)
7528 static const uint32_t CH_CTRL_TRIG_TREQ_SEL__TIMER3 = 62;
7529 // Permanent request, for unpaced transfers.
7530 static const uint32_t CH_CTRL_TRIG_TREQ_SEL__PERMANENT = 63;
7531 static const uint32_t CH_CTRL_TRIG_RING_SIZE__RING_NONE = 0;
7532 static const uint32_t CH_CTRL_TRIG_DATA_SIZE__SIZE_BYTE = 0;
7533 static const uint32_t CH_CTRL_TRIG_DATA_SIZE__SIZE_HALFWORD = 1;
7534 static const uint32_t CH_CTRL_TRIG_DATA_SIZE__SIZE_WORD = 2;
7535
7536 // Alias for channel 0 CTRL register
7537 // Reset value: 0x00000000
7538 typedef uint32_t CH_AL1_CTRL_t;
7539
7540 // Alias for channel 0 READ_ADDR register
7541 // Reset value: 0x00000000
7542 typedef uint32_t CH_AL1_READ_ADDR_t;
7543
7544 // Alias for channel 0 WRITE_ADDR register
7545 // Reset value: 0x00000000
7546 typedef uint32_t CH_AL1_WRITE_ADDR_t;
7547
7548 // Alias for channel 0 TRANS_COUNT register
7549 // This is a trigger register (0xc). Writing a nonzero value will
7550 // reload the channel counter and start the channel.
7551 // Reset value: 0x00000000
7552 typedef uint32_t CH_AL1_TRANS_COUNT_TRIG_t;
7553
7554 // Alias for channel 0 CTRL register
7555 // Reset value: 0x00000000
7556 typedef uint32_t CH_AL2_CTRL_t;
7557
7558 // Alias for channel 0 TRANS_COUNT register
7559 // Reset value: 0x00000000
7560 typedef uint32_t CH_AL2_TRANS_COUNT_t;
7561
7562 // Alias for channel 0 READ_ADDR register
7563 // Reset value: 0x00000000
7564 typedef uint32_t CH_AL2_READ_ADDR_t;
7565
7566 // Alias for channel 0 WRITE_ADDR register
7567 // This is a trigger register (0xc). Writing a nonzero value will
7568 // reload the channel counter and start the channel.
7569 // Reset value: 0x00000000
7570 typedef uint32_t CH_AL2_WRITE_ADDR_TRIG_t;
7571
7572 // Alias for channel 0 CTRL register
7573 // Reset value: 0x00000000
7574 typedef uint32_t CH_AL3_CTRL_t;
7575
7576 // Alias for channel 0 WRITE_ADDR register
7577 // Reset value: 0x00000000
7578 typedef uint32_t CH_AL3_WRITE_ADDR_t;
7579
7580 // Alias for channel 0 TRANS_COUNT register
7581 // Reset value: 0x00000000
7582 typedef uint32_t CH_AL3_TRANS_COUNT_t;
7583
7584 // Alias for channel 0 READ_ADDR register
7585 // This is a trigger register (0xc). Writing a nonzero value will
7586 // reload the channel counter and start the channel.
7587 // Reset value: 0x00000000
7588 typedef uint32_t CH_AL3_READ_ADDR_TRIG_t;
7589
7590 // Interrupt Status (raw)
7591 // Reset value: 0x00000000
7592 BEGIN_TYPE(INTR_t, uint32_t)
7593 // Raw interrupt status for DMA Channels 0..15. Bit n corresponds to channel n. Ignores any masking or forcing. Channel interrupts can be cleared by writing a bit mask to INTR, INTS0 or INTS1.
7594 //
7595 // Channel interrupts can be routed to either of two system-level IRQs based on INTE0 and INTE1.
7596 //
7597 // This can be used vector different channel interrupts to different ISRs: this might be done to allow NVIC IRQ preemption for more time-critical channels, or to spread IRQ load across different cores.
7598 //
7599 // It is also valid to ignore this behaviour and just use INTE0/INTS0/IRQ 0.
7600 ADD_BITFIELD_RW(INTR, 0, 16)
7601 END_TYPE()
7602
7603 // Interrupt Enables for IRQ 0
7604 // Reset value: 0x00000000
7605 BEGIN_TYPE(INTE0_t, uint32_t)
7606 // Set bit n to pass interrupts from channel n to DMA IRQ 0.
7607 ADD_BITFIELD_RW(INTE0, 0, 16)
7608 END_TYPE()
7609
7610 // Force Interrupts
7611 // Reset value: 0x00000000
7612 BEGIN_TYPE(INTF0_t, uint32_t)
7613 // Write 1s to force the corresponding bits in INTE0. The interrupt remains asserted until INTF0 is cleared.
7614 ADD_BITFIELD_RW(INTF0, 0, 16)
7615 END_TYPE()
7616
7617 // Interrupt Status for IRQ 0
7618 // Reset value: 0x00000000
7619 BEGIN_TYPE(INTS0_t, uint32_t)
7620 // Indicates active channel interrupt requests which are currently causing IRQ 0 to be asserted.
7621 // Channel interrupts can be cleared by writing a bit mask here.
7622 ADD_BITFIELD_RW(INTS0, 0, 16)
7623 END_TYPE()
7624
7625 // Interrupt Enables for IRQ 1
7626 // Reset value: 0x00000000
7627 BEGIN_TYPE(INTE1_t, uint32_t)
7628 // Set bit n to pass interrupts from channel n to DMA IRQ 1.
7629 ADD_BITFIELD_RW(INTE1, 0, 16)
7630 END_TYPE()
7631
7632 // Force Interrupts for IRQ 1
7633 // Reset value: 0x00000000
7634 BEGIN_TYPE(INTF1_t, uint32_t)
7635 // Write 1s to force the corresponding bits in INTE0. The interrupt remains asserted until INTF0 is cleared.
7636 ADD_BITFIELD_RW(INTF1, 0, 16)
7637 END_TYPE()
7638
7639 // Interrupt Status (masked) for IRQ 1
7640 // Reset value: 0x00000000
7641 BEGIN_TYPE(INTS1_t, uint32_t)
7642 // Indicates active channel interrupt requests which are currently causing IRQ 1 to be asserted.
7643 // Channel interrupts can be cleared by writing a bit mask here.
7644 ADD_BITFIELD_RW(INTS1, 0, 16)
7645 END_TYPE()
7646
7647 // Pacing (X/Y) Fractional Timer
7648 // The pacing timer produces TREQ assertions at a rate set by ((X/Y) * sys_clk). This equation is evaluated every sys_clk cycles and therefore can only generate TREQs at a rate of 1 per sys_clk (i.e. permanent TREQ) or less.
7649 // Reset value: 0x00000000
7650 BEGIN_TYPE(TIMER_t, uint32_t)
7651 // Pacing Timer Dividend. Specifies the X value for the (X/Y) fractional timer.
7652 ADD_BITFIELD_RW(X, 16, 16)
7653 // Pacing Timer Divisor. Specifies the Y value for the (X/Y) fractional timer.
7654 ADD_BITFIELD_RW(Y, 0, 16)
7655 END_TYPE()
7656
7657 // Trigger one or more channels simultaneously
7658 // Reset value: 0x00000000
7659 BEGIN_TYPE(MULTI_CHAN_TRIGGER_t, uint32_t)
7660 // Each bit in this register corresponds to a DMA channel. Writing a 1 to the relevant bit is the same as writing to that channel's trigger register; the channel will start if it is currently enabled and not already busy.
7661 ADD_BITFIELD_RW(MULTI_CHAN_TRIGGER, 0, 16)
7662 END_TYPE()
7663
7664 // Sniffer Control
7665 // Reset value: 0x00000000
7666 BEGIN_TYPE(SNIFF_CTRL_t, uint32_t)
7667 // If set, the result appears inverted (bitwise complement) when read. This does not affect the way the checksum is calculated; the result is transformed on-the-fly between the result register and the bus.
7668 ADD_BITFIELD_RW(OUT_INV, 11, 1)
7669 // If set, the result appears bit-reversed when read. This does not affect the way the checksum is calculated; the result is transformed on-the-fly between the result register and the bus.
7670 ADD_BITFIELD_RW(OUT_REV, 10, 1)
7671 // Locally perform a byte reverse on the sniffed data, before feeding into checksum.
7672 //
7673 // Note that the sniff hardware is downstream of the DMA channel byteswap performed in the read master: if channel CTRL_BSWAP and SNIFF_CTRL_BSWAP are both enabled, their effects cancel from the sniffer's point of view.
7674 ADD_BITFIELD_RW(BSWAP, 9, 1)
7675 ADD_BITFIELD_RW(CALC, 5, 4)
7676 // DMA channel for Sniffer to observe
7677 ADD_BITFIELD_RW(DMACH, 1, 4)
7678 // Enable sniffer
7679 ADD_BITFIELD_RW(EN, 0, 1)
7680 END_TYPE()
7681
7682 // Calculate a CRC-32 (IEEE802.3 polynomial)
7683 static const uint32_t SNIFF_CTRL_CALC__CRC32 = 0;
7684 // Calculate a CRC-32 (IEEE802.3 polynomial) with bit reversed data
7685 static const uint32_t SNIFF_CTRL_CALC__CRC32R = 1;
7686 // Calculate a CRC-16-CCITT
7687 static const uint32_t SNIFF_CTRL_CALC__CRC16 = 2;
7688 // Calculate a CRC-16-CCITT with bit reversed data
7689 static const uint32_t SNIFF_CTRL_CALC__CRC16R = 3;
7690 // XOR reduction over all data. == 1 if the total 1 population count is odd.
7691 static const uint32_t SNIFF_CTRL_CALC__EVEN = 14;
7692 // Calculate a simple 32-bit checksum (addition with a 32 bit accumulator)
7693 static const uint32_t SNIFF_CTRL_CALC__SUM = 15;
7694
7695 // Data accumulator for sniff hardware
7696 // Write an initial seed value here before starting a DMA transfer on the channel indicated by SNIFF_CTRL_DMACH. The hardware will update this register each time it observes a read from the indicated channel. Once the channel completes, the final result can be read from this register.
7697 // Reset value: 0x00000000
7698 typedef uint32_t SNIFF_DATA_t;
7699
7700 // Debug RAF, WAF, TDF levels
7701 // Reset value: 0x00000000
7702 BEGIN_TYPE(FIFO_LEVELS_t, uint32_t)
7703 // Current Read-Address-FIFO fill level
7704 ADD_BITFIELD_RO(RAF_LVL, 16, 8)
7705 // Current Write-Address-FIFO fill level
7706 ADD_BITFIELD_RO(WAF_LVL, 8, 8)
7707 // Current Transfer-Data-FIFO fill level
7708 ADD_BITFIELD_RO(TDF_LVL, 0, 8)
7709 END_TYPE()
7710
7711 // Abort an in-progress transfer sequence on one or more channels
7712 // Reset value: 0x00000000
7713 BEGIN_TYPE(CHAN_ABORT_t, uint32_t)
7714 // Each bit corresponds to a channel. Writing a 1 aborts whatever transfer sequence is in progress on that channel. The bit will remain high until any in-flight transfers have been flushed through the address and data FIFOs.
7715 //
7716 // After writing, this register must be polled until it returns all-zero. Until this point, it is unsafe to restart the channel.
7717 ADD_BITFIELD_RW(CHAN_ABORT, 0, 16)
7718 END_TYPE()
7719
7720 // The number of channels this DMA instance is equipped with. This DMA supports up to 16 hardware channels, but can be configured with as few as one, to minimise silicon area.
7721 // Reset value: 0x00000000
7722 BEGIN_TYPE(N_CHANNELS_t, uint32_t)
7723 ADD_BITFIELD_RO(N_CHANNELS, 0, 5)
7724 END_TYPE()
7725
7726 // Read: get channel DREQ counter (i.e. how many accesses the DMA expects it can perform on the peripheral without overflow/underflow. Write any value: clears the counter, and cause channel to re-initiate DREQ handshake.
7727 // Reset value: 0x00000000
7728 BEGIN_TYPE(CH_DBG_CTDREQ_t, uint32_t)
7729 ADD_BITFIELD_RW(DBG_CTDREQ, 0, 6)
7730 END_TYPE()
7731
7732 // Read to get channel TRANS_COUNT reload value, i.e. the length of the next transfer
7733 // Reset value: 0x00000000
7734 typedef uint32_t CH_DBG_TCR_t;
7735
7736 struct DMA_t {
7737 CH_READ_ADDR_t CH0_READ_ADDR;
7738 CH_WRITE_ADDR_t CH0_WRITE_ADDR;
7739 CH_TRANS_COUNT_t CH0_TRANS_COUNT;
7740 CH_CTRL_TRIG_t CH0_CTRL_TRIG;
7741 CH_AL1_CTRL_t CH0_AL1_CTRL;
7742 CH_AL1_READ_ADDR_t CH0_AL1_READ_ADDR;
7743 CH_AL1_WRITE_ADDR_t CH0_AL1_WRITE_ADDR;
7744 CH_AL1_TRANS_COUNT_TRIG_t CH0_AL1_TRANS_COUNT_TRIG;
7745 CH_AL2_CTRL_t CH0_AL2_CTRL;
7746 CH_AL2_TRANS_COUNT_t CH0_AL2_TRANS_COUNT;
7747 CH_AL2_READ_ADDR_t CH0_AL2_READ_ADDR;
7748 CH_AL2_WRITE_ADDR_TRIG_t CH0_AL2_WRITE_ADDR_TRIG;
7749 CH_AL3_CTRL_t CH0_AL3_CTRL;
7750 CH_AL3_WRITE_ADDR_t CH0_AL3_WRITE_ADDR;
7751 CH_AL3_TRANS_COUNT_t CH0_AL3_TRANS_COUNT;
7752 CH_AL3_READ_ADDR_TRIG_t CH0_AL3_READ_ADDR_TRIG;
7753 CH_READ_ADDR_t CH1_READ_ADDR;
7754 CH_WRITE_ADDR_t CH1_WRITE_ADDR;
7755 CH_TRANS_COUNT_t CH1_TRANS_COUNT;
7756 CH_CTRL_TRIG_t CH1_CTRL_TRIG;
7757 CH_AL1_CTRL_t CH1_AL1_CTRL;
7758 CH_AL1_READ_ADDR_t CH1_AL1_READ_ADDR;
7759 CH_AL1_WRITE_ADDR_t CH1_AL1_WRITE_ADDR;
7760 CH_AL1_TRANS_COUNT_TRIG_t CH1_AL1_TRANS_COUNT_TRIG;
7761 CH_AL2_CTRL_t CH1_AL2_CTRL;
7762 CH_AL2_TRANS_COUNT_t CH1_AL2_TRANS_COUNT;
7763 CH_AL2_READ_ADDR_t CH1_AL2_READ_ADDR;
7764 CH_AL2_WRITE_ADDR_TRIG_t CH1_AL2_WRITE_ADDR_TRIG;
7765 CH_AL3_CTRL_t CH1_AL3_CTRL;
7766 CH_AL3_WRITE_ADDR_t CH1_AL3_WRITE_ADDR;
7767 CH_AL3_TRANS_COUNT_t CH1_AL3_TRANS_COUNT;
7768 CH_AL3_READ_ADDR_TRIG_t CH1_AL3_READ_ADDR_TRIG;
7769 CH_READ_ADDR_t CH2_READ_ADDR;
7770 CH_WRITE_ADDR_t CH2_WRITE_ADDR;
7771 CH_TRANS_COUNT_t CH2_TRANS_COUNT;
7772 CH_CTRL_TRIG_t CH2_CTRL_TRIG;
7773 CH_AL1_CTRL_t CH2_AL1_CTRL;
7774 CH_AL1_READ_ADDR_t CH2_AL1_READ_ADDR;
7775 CH_AL1_WRITE_ADDR_t CH2_AL1_WRITE_ADDR;
7776 CH_AL1_TRANS_COUNT_TRIG_t CH2_AL1_TRANS_COUNT_TRIG;
7777 CH_AL2_CTRL_t CH2_AL2_CTRL;
7778 CH_AL2_TRANS_COUNT_t CH2_AL2_TRANS_COUNT;
7779 CH_AL2_READ_ADDR_t CH2_AL2_READ_ADDR;
7780 CH_AL2_WRITE_ADDR_TRIG_t CH2_AL2_WRITE_ADDR_TRIG;
7781 CH_AL3_CTRL_t CH2_AL3_CTRL;
7782 CH_AL3_WRITE_ADDR_t CH2_AL3_WRITE_ADDR;
7783 CH_AL3_TRANS_COUNT_t CH2_AL3_TRANS_COUNT;
7784 CH_AL3_READ_ADDR_TRIG_t CH2_AL3_READ_ADDR_TRIG;
7785 CH_READ_ADDR_t CH3_READ_ADDR;
7786 CH_WRITE_ADDR_t CH3_WRITE_ADDR;
7787 CH_TRANS_COUNT_t CH3_TRANS_COUNT;
7788 CH_CTRL_TRIG_t CH3_CTRL_TRIG;
7789 CH_AL1_CTRL_t CH3_AL1_CTRL;
7790 CH_AL1_READ_ADDR_t CH3_AL1_READ_ADDR;
7791 CH_AL1_WRITE_ADDR_t CH3_AL1_WRITE_ADDR;
7792 CH_AL1_TRANS_COUNT_TRIG_t CH3_AL1_TRANS_COUNT_TRIG;
7793 CH_AL2_CTRL_t CH3_AL2_CTRL;
7794 CH_AL2_TRANS_COUNT_t CH3_AL2_TRANS_COUNT;
7795 CH_AL2_READ_ADDR_t CH3_AL2_READ_ADDR;
7796 CH_AL2_WRITE_ADDR_TRIG_t CH3_AL2_WRITE_ADDR_TRIG;
7797 CH_AL3_CTRL_t CH3_AL3_CTRL;
7798 CH_AL3_WRITE_ADDR_t CH3_AL3_WRITE_ADDR;
7799 CH_AL3_TRANS_COUNT_t CH3_AL3_TRANS_COUNT;
7800 CH_AL3_READ_ADDR_TRIG_t CH3_AL3_READ_ADDR_TRIG;
7801 CH_READ_ADDR_t CH4_READ_ADDR;
7802 CH_WRITE_ADDR_t CH4_WRITE_ADDR;
7803 CH_TRANS_COUNT_t CH4_TRANS_COUNT;
7804 CH_CTRL_TRIG_t CH4_CTRL_TRIG;
7805 CH_AL1_CTRL_t CH4_AL1_CTRL;
7806 CH_AL1_READ_ADDR_t CH4_AL1_READ_ADDR;
7807 CH_AL1_WRITE_ADDR_t CH4_AL1_WRITE_ADDR;
7808 CH_AL1_TRANS_COUNT_TRIG_t CH4_AL1_TRANS_COUNT_TRIG;
7809 CH_AL2_CTRL_t CH4_AL2_CTRL;
7810 CH_AL2_TRANS_COUNT_t CH4_AL2_TRANS_COUNT;
7811 CH_AL2_READ_ADDR_t CH4_AL2_READ_ADDR;
7812 CH_AL2_WRITE_ADDR_TRIG_t CH4_AL2_WRITE_ADDR_TRIG;
7813 CH_AL3_CTRL_t CH4_AL3_CTRL;
7814 CH_AL3_WRITE_ADDR_t CH4_AL3_WRITE_ADDR;
7815 CH_AL3_TRANS_COUNT_t CH4_AL3_TRANS_COUNT;
7816 CH_AL3_READ_ADDR_TRIG_t CH4_AL3_READ_ADDR_TRIG;
7817 CH_READ_ADDR_t CH5_READ_ADDR;
7818 CH_WRITE_ADDR_t CH5_WRITE_ADDR;
7819 CH_TRANS_COUNT_t CH5_TRANS_COUNT;
7820 CH_CTRL_TRIG_t CH5_CTRL_TRIG;
7821 CH_AL1_CTRL_t CH5_AL1_CTRL;
7822 CH_AL1_READ_ADDR_t CH5_AL1_READ_ADDR;
7823 CH_AL1_WRITE_ADDR_t CH5_AL1_WRITE_ADDR;
7824 CH_AL1_TRANS_COUNT_TRIG_t CH5_AL1_TRANS_COUNT_TRIG;
7825 CH_AL2_CTRL_t CH5_AL2_CTRL;
7826 CH_AL2_TRANS_COUNT_t CH5_AL2_TRANS_COUNT;
7827 CH_AL2_READ_ADDR_t CH5_AL2_READ_ADDR;
7828 CH_AL2_WRITE_ADDR_TRIG_t CH5_AL2_WRITE_ADDR_TRIG;
7829 CH_AL3_CTRL_t CH5_AL3_CTRL;
7830 CH_AL3_WRITE_ADDR_t CH5_AL3_WRITE_ADDR;
7831 CH_AL3_TRANS_COUNT_t CH5_AL3_TRANS_COUNT;
7832 CH_AL3_READ_ADDR_TRIG_t CH5_AL3_READ_ADDR_TRIG;
7833 CH_READ_ADDR_t CH6_READ_ADDR;
7834 CH_WRITE_ADDR_t CH6_WRITE_ADDR;
7835 CH_TRANS_COUNT_t CH6_TRANS_COUNT;
7836 CH_CTRL_TRIG_t CH6_CTRL_TRIG;
7837 CH_AL1_CTRL_t CH6_AL1_CTRL;
7838 CH_AL1_READ_ADDR_t CH6_AL1_READ_ADDR;
7839 CH_AL1_WRITE_ADDR_t CH6_AL1_WRITE_ADDR;
7840 CH_AL1_TRANS_COUNT_TRIG_t CH6_AL1_TRANS_COUNT_TRIG;
7841 CH_AL2_CTRL_t CH6_AL2_CTRL;
7842 CH_AL2_TRANS_COUNT_t CH6_AL2_TRANS_COUNT;
7843 CH_AL2_READ_ADDR_t CH6_AL2_READ_ADDR;
7844 CH_AL2_WRITE_ADDR_TRIG_t CH6_AL2_WRITE_ADDR_TRIG;
7845 CH_AL3_CTRL_t CH6_AL3_CTRL;
7846 CH_AL3_WRITE_ADDR_t CH6_AL3_WRITE_ADDR;
7847 CH_AL3_TRANS_COUNT_t CH6_AL3_TRANS_COUNT;
7848 CH_AL3_READ_ADDR_TRIG_t CH6_AL3_READ_ADDR_TRIG;
7849 CH_READ_ADDR_t CH7_READ_ADDR;
7850 CH_WRITE_ADDR_t CH7_WRITE_ADDR;
7851 CH_TRANS_COUNT_t CH7_TRANS_COUNT;
7852 CH_CTRL_TRIG_t CH7_CTRL_TRIG;
7853 CH_AL1_CTRL_t CH7_AL1_CTRL;
7854 CH_AL1_READ_ADDR_t CH7_AL1_READ_ADDR;
7855 CH_AL1_WRITE_ADDR_t CH7_AL1_WRITE_ADDR;
7856 CH_AL1_TRANS_COUNT_TRIG_t CH7_AL1_TRANS_COUNT_TRIG;
7857 CH_AL2_CTRL_t CH7_AL2_CTRL;
7858 CH_AL2_TRANS_COUNT_t CH7_AL2_TRANS_COUNT;
7859 CH_AL2_READ_ADDR_t CH7_AL2_READ_ADDR;
7860 CH_AL2_WRITE_ADDR_TRIG_t CH7_AL2_WRITE_ADDR_TRIG;
7861 CH_AL3_CTRL_t CH7_AL3_CTRL;
7862 CH_AL3_WRITE_ADDR_t CH7_AL3_WRITE_ADDR;
7863 CH_AL3_TRANS_COUNT_t CH7_AL3_TRANS_COUNT;
7864 CH_AL3_READ_ADDR_TRIG_t CH7_AL3_READ_ADDR_TRIG;
7865 CH_READ_ADDR_t CH8_READ_ADDR;
7866 CH_WRITE_ADDR_t CH8_WRITE_ADDR;
7867 CH_TRANS_COUNT_t CH8_TRANS_COUNT;
7868 CH_CTRL_TRIG_t CH8_CTRL_TRIG;
7869 CH_AL1_CTRL_t CH8_AL1_CTRL;
7870 CH_AL1_READ_ADDR_t CH8_AL1_READ_ADDR;
7871 CH_AL1_WRITE_ADDR_t CH8_AL1_WRITE_ADDR;
7872 CH_AL1_TRANS_COUNT_TRIG_t CH8_AL1_TRANS_COUNT_TRIG;
7873 CH_AL2_CTRL_t CH8_AL2_CTRL;
7874 CH_AL2_TRANS_COUNT_t CH8_AL2_TRANS_COUNT;
7875 CH_AL2_READ_ADDR_t CH8_AL2_READ_ADDR;
7876 CH_AL2_WRITE_ADDR_TRIG_t CH8_AL2_WRITE_ADDR_TRIG;
7877 CH_AL3_CTRL_t CH8_AL3_CTRL;
7878 CH_AL3_WRITE_ADDR_t CH8_AL3_WRITE_ADDR;
7879 CH_AL3_TRANS_COUNT_t CH8_AL3_TRANS_COUNT;
7880 CH_AL3_READ_ADDR_TRIG_t CH8_AL3_READ_ADDR_TRIG;
7881 CH_READ_ADDR_t CH9_READ_ADDR;
7882 CH_WRITE_ADDR_t CH9_WRITE_ADDR;
7883 CH_TRANS_COUNT_t CH9_TRANS_COUNT;
7884 CH_CTRL_TRIG_t CH9_CTRL_TRIG;
7885 CH_AL1_CTRL_t CH9_AL1_CTRL;
7886 CH_AL1_READ_ADDR_t CH9_AL1_READ_ADDR;
7887 CH_AL1_WRITE_ADDR_t CH9_AL1_WRITE_ADDR;
7888 CH_AL1_TRANS_COUNT_TRIG_t CH9_AL1_TRANS_COUNT_TRIG;
7889 CH_AL2_CTRL_t CH9_AL2_CTRL;
7890 CH_AL2_TRANS_COUNT_t CH9_AL2_TRANS_COUNT;
7891 CH_AL2_READ_ADDR_t CH9_AL2_READ_ADDR;
7892 CH_AL2_WRITE_ADDR_TRIG_t CH9_AL2_WRITE_ADDR_TRIG;
7893 CH_AL3_CTRL_t CH9_AL3_CTRL;
7894 CH_AL3_WRITE_ADDR_t CH9_AL3_WRITE_ADDR;
7895 CH_AL3_TRANS_COUNT_t CH9_AL3_TRANS_COUNT;
7896 CH_AL3_READ_ADDR_TRIG_t CH9_AL3_READ_ADDR_TRIG;
7897 CH_READ_ADDR_t CH10_READ_ADDR;
7898 CH_WRITE_ADDR_t CH10_WRITE_ADDR;
7899 CH_TRANS_COUNT_t CH10_TRANS_COUNT;
7900 CH_CTRL_TRIG_t CH10_CTRL_TRIG;
7901 CH_AL1_CTRL_t CH10_AL1_CTRL;
7902 CH_AL1_READ_ADDR_t CH10_AL1_READ_ADDR;
7903 CH_AL1_WRITE_ADDR_t CH10_AL1_WRITE_ADDR;
7904 CH_AL1_TRANS_COUNT_TRIG_t CH10_AL1_TRANS_COUNT_TRIG;
7905 CH_AL2_CTRL_t CH10_AL2_CTRL;
7906 CH_AL2_TRANS_COUNT_t CH10_AL2_TRANS_COUNT;
7907 CH_AL2_READ_ADDR_t CH10_AL2_READ_ADDR;
7908 CH_AL2_WRITE_ADDR_TRIG_t CH10_AL2_WRITE_ADDR_TRIG;
7909 CH_AL3_CTRL_t CH10_AL3_CTRL;
7910 CH_AL3_WRITE_ADDR_t CH10_AL3_WRITE_ADDR;
7911 CH_AL3_TRANS_COUNT_t CH10_AL3_TRANS_COUNT;
7912 CH_AL3_READ_ADDR_TRIG_t CH10_AL3_READ_ADDR_TRIG;
7913 CH_READ_ADDR_t CH11_READ_ADDR;
7914 CH_WRITE_ADDR_t CH11_WRITE_ADDR;
7915 CH_TRANS_COUNT_t CH11_TRANS_COUNT;
7916 CH_CTRL_TRIG_t CH11_CTRL_TRIG;
7917 CH_AL1_CTRL_t CH11_AL1_CTRL;
7918 CH_AL1_READ_ADDR_t CH11_AL1_READ_ADDR;
7919 CH_AL1_WRITE_ADDR_t CH11_AL1_WRITE_ADDR;
7920 CH_AL1_TRANS_COUNT_TRIG_t CH11_AL1_TRANS_COUNT_TRIG;
7921 CH_AL2_CTRL_t CH11_AL2_CTRL;
7922 CH_AL2_TRANS_COUNT_t CH11_AL2_TRANS_COUNT;
7923 CH_AL2_READ_ADDR_t CH11_AL2_READ_ADDR;
7924 CH_AL2_WRITE_ADDR_TRIG_t CH11_AL2_WRITE_ADDR_TRIG;
7925 CH_AL3_CTRL_t CH11_AL3_CTRL;
7926 CH_AL3_WRITE_ADDR_t CH11_AL3_WRITE_ADDR;
7927 CH_AL3_TRANS_COUNT_t CH11_AL3_TRANS_COUNT;
7928 CH_AL3_READ_ADDR_TRIG_t CH11_AL3_READ_ADDR_TRIG;
7929 uint32_t reserved0[64];
7930 INTR_t INTR;
7931 INTE0_t INTE0;
7932 INTF0_t INTF0;
7933 INTS0_t INTS0;
7934 uint32_t reserved1;
7935 INTE1_t INTE1;
7936 INTF1_t INTF1;
7937 INTS1_t INTS1;
7938 TIMER_t TIMER[4];
7939 MULTI_CHAN_TRIGGER_t MULTI_CHAN_TRIGGER;
7940 SNIFF_CTRL_t SNIFF_CTRL;
7941 SNIFF_DATA_t SNIFF_DATA;
7942 uint32_t reserved2;
7943 FIFO_LEVELS_t FIFO_LEVELS;
7944 CHAN_ABORT_t CHAN_ABORT;
7945 N_CHANNELS_t N_CHANNELS;
7946 uint32_t reserved3[237];
7947 CH_DBG_CTDREQ_t CH0_DBG_CTDREQ;
7948 CH_DBG_TCR_t CH0_DBG_TCR;
7949 uint32_t reserved4[14];
7950 CH_DBG_CTDREQ_t CH1_DBG_CTDREQ;
7951 CH_DBG_TCR_t CH1_DBG_TCR;
7952 uint32_t reserved5[14];
7953 CH_DBG_CTDREQ_t CH2_DBG_CTDREQ;
7954 CH_DBG_TCR_t CH2_DBG_TCR;
7955 uint32_t reserved6[14];
7956 CH_DBG_CTDREQ_t CH3_DBG_CTDREQ;
7957 CH_DBG_TCR_t CH3_DBG_TCR;
7958 uint32_t reserved7[14];
7959 CH_DBG_CTDREQ_t CH4_DBG_CTDREQ;
7960 CH_DBG_TCR_t CH4_DBG_TCR;
7961 uint32_t reserved8[14];
7962 CH_DBG_CTDREQ_t CH5_DBG_CTDREQ;
7963 CH_DBG_TCR_t CH5_DBG_TCR;
7964 uint32_t reserved9[14];
7965 CH_DBG_CTDREQ_t CH6_DBG_CTDREQ;
7966 CH_DBG_TCR_t CH6_DBG_TCR;
7967 uint32_t reserved10[14];
7968 CH_DBG_CTDREQ_t CH7_DBG_CTDREQ;
7969 CH_DBG_TCR_t CH7_DBG_TCR;
7970 uint32_t reserved11[14];
7971 CH_DBG_CTDREQ_t CH8_DBG_CTDREQ;
7972 CH_DBG_TCR_t CH8_DBG_TCR;
7973 uint32_t reserved12[14];
7974 CH_DBG_CTDREQ_t CH9_DBG_CTDREQ;
7975 CH_DBG_TCR_t CH9_DBG_TCR;
7976 uint32_t reserved13[14];
7977 CH_DBG_CTDREQ_t CH10_DBG_CTDREQ;
7978 CH_DBG_TCR_t CH10_DBG_TCR;
7979 uint32_t reserved14[14];
7980 CH_DBG_CTDREQ_t CH11_DBG_CTDREQ;
7981 CH_DBG_TCR_t CH11_DBG_TCR;
7982 };
7983
7984 static DMA_t & DMA = (*(DMA_t *)0x50000000);
7985 static DMA_t & DMA_XOR = (*(DMA_t *)0x50001000);
7986 static DMA_t & DMA_SET = (*(DMA_t *)0x50002000);
7987 static DMA_t & DMA_CLR = (*(DMA_t *)0x50003000);
7988
7989} // _DMA_
7990
7991// DPRAM layout for USB device.
7992namespace _USBCTRL_DPRAM_ {
7993
7994 // Bytes 0-3 of the SETUP packet from the host.
7995 // Reset value: 0x00000000
7996 BEGIN_TYPE(SETUP_PACKET_LOW_t, uint32_t)
7997 ADD_BITFIELD_RW(WVALUE, 16, 16)
7998 ADD_BITFIELD_RW(BREQUEST, 8, 8)
7999 ADD_BITFIELD_RW(BMREQUESTTYPE, 0, 8)
8000 END_TYPE()
8001
8002 // Bytes 4-7 of the setup packet from the host.
8003 // Reset value: 0x00000000
8004 BEGIN_TYPE(SETUP_PACKET_HIGH_t, uint32_t)
8005 ADD_BITFIELD_RW(WLENGTH, 16, 16)
8006 ADD_BITFIELD_RW(WINDEX, 0, 16)
8007 END_TYPE()
8008
8009 // Reset value: 0x00000000
8010 BEGIN_TYPE(EP_CONTROL_t, uint32_t)
8011 // Enable this endpoint. The device will not reply to any packets for this endpoint if this bit is not set.
8012 ADD_BITFIELD_RW(ENABLE, 31, 1)
8013 // This endpoint is double buffered.
8014 ADD_BITFIELD_RW(DOUBLE_BUFFERED, 30, 1)
8015 // Trigger an interrupt each time a buffer is done.
8016 ADD_BITFIELD_RW(INTERRUPT_PER_BUFF, 29, 1)
8017 // Trigger an interrupt each time both buffers are done. Only valid in double buffered mode.
8018 ADD_BITFIELD_RW(INTERRUPT_PER_DOUBLE_BUFF, 28, 1)
8019 ADD_BITFIELD_RW(ENDPOINT_TYPE, 26, 2)
8020 // Trigger an interrupt if a STALL is sent. Intended for debug only.
8021 ADD_BITFIELD_RW(INTERRUPT_ON_STALL, 17, 1)
8022 // Trigger an interrupt if a NAK is sent. Intended for debug only.
8023 ADD_BITFIELD_RW(INTERRUPT_ON_NAK, 16, 1)
8024 // 64 byte aligned buffer address for this EP (bits 0-5 are ignored). Relative to the start of the DPRAM.
8025 ADD_BITFIELD_RW(BUFFER_ADDRESS, 0, 16)
8026 END_TYPE()
8027
8028 static const uint32_t EP_CONTROL_ENDPOINT_TYPE__Control = 0;
8029 static const uint32_t EP_CONTROL_ENDPOINT_TYPE__Isochronous = 1;
8030 static const uint32_t EP_CONTROL_ENDPOINT_TYPE__Bulk = 2;
8031 static const uint32_t EP_CONTROL_ENDPOINT_TYPE__Interrupt = 3;
8032
8033 // Buffer control for both buffers of an endpoint. Fields ending in a _1 are for buffer 1.
8034 // Fields ending in a _0 are for buffer 0. Buffer 1 controls are only valid if the endpoint is in double buffered mode.
8035 // Reset value: 0x00000000
8036 BEGIN_TYPE(EP_BUFFER_CONTROL_t, uint32_t)
8037 // Buffer 1 is full. For an IN transfer (TX to the host) the bit is set to indicate the data is valid. For an OUT transfer (RX from the host) this bit should be left as a 0. The host will set it when it has filled the buffer with data.
8038 ADD_BITFIELD_RW(FULL_1, 31, 1)
8039 // Buffer 1 is the last buffer of the transfer.
8040 ADD_BITFIELD_RW(LAST_1, 30, 1)
8041 // The data pid of buffer 1.
8042 ADD_BITFIELD_RW(PID_1, 29, 1)
8043 // The number of bytes buffer 1 is offset from buffer 0 in Isochronous mode. Only valid in double buffered mode for an Isochronous endpoint.
8044 // For a non Isochronous endpoint the offset is always 64 bytes.
8045 ADD_BITFIELD_RW(DOUBLE_BUFFER_ISO_OFFSET, 27, 2)
8046 // Buffer 1 is available. This bit is set to indicate the buffer can be used by the controller. The controller clears the available bit when writing the status back.
8047 ADD_BITFIELD_RW(AVAILABLE_1, 26, 1)
8048 // The length of the data in buffer 1.
8049 ADD_BITFIELD_RW(LENGTH_1, 16, 10)
8050 // Buffer 0 is full. For an IN transfer (TX to the host) the bit is set to indicate the data is valid. For an OUT transfer (RX from the host) this bit should be left as a 0. The host will set it when it has filled the buffer with data.
8051 ADD_BITFIELD_RW(FULL_0, 15, 1)
8052 // Buffer 0 is the last buffer of the transfer.
8053 ADD_BITFIELD_RW(LAST_0, 14, 1)
8054 // The data pid of buffer 0.
8055 ADD_BITFIELD_RW(PID_0, 13, 1)
8056 // Reset the buffer selector to buffer 0.
8057 ADD_BITFIELD_RW(RESET, 12, 1)
8058 // Reply with a stall (valid for both buffers).
8059 ADD_BITFIELD_RW(STALL, 11, 1)
8060 // Buffer 0 is available. This bit is set to indicate the buffer can be used by the controller. The controller clears the available bit when writing the status back.
8061 ADD_BITFIELD_RW(AVAILABLE_0, 10, 1)
8062 // The length of the data in buffer 0.
8063 ADD_BITFIELD_RW(LENGTH_0, 0, 10)
8064 END_TYPE()
8065
8066 static const uint32_t EP_BUFFER_CONTROL_DOUBLE_BUFFER_ISO_OFFSET__128 = 0;
8067 static const uint32_t EP_BUFFER_CONTROL_DOUBLE_BUFFER_ISO_OFFSET__256 = 1;
8068 static const uint32_t EP_BUFFER_CONTROL_DOUBLE_BUFFER_ISO_OFFSET__512 = 2;
8069 static const uint32_t EP_BUFFER_CONTROL_DOUBLE_BUFFER_ISO_OFFSET__1024 = 3;
8070
8072 SETUP_PACKET_LOW_t SETUP_PACKET_LOW;
8073 SETUP_PACKET_HIGH_t SETUP_PACKET_HIGH;
8074 EP_CONTROL_t EP1_IN_CONTROL;
8075 EP_CONTROL_t EP1_OUT_CONTROL;
8076 EP_CONTROL_t EP2_IN_CONTROL;
8077 EP_CONTROL_t EP2_OUT_CONTROL;
8078 EP_CONTROL_t EP3_IN_CONTROL;
8079 EP_CONTROL_t EP3_OUT_CONTROL;
8080 EP_CONTROL_t EP4_IN_CONTROL;
8081 EP_CONTROL_t EP4_OUT_CONTROL;
8082 EP_CONTROL_t EP5_IN_CONTROL;
8083 EP_CONTROL_t EP5_OUT_CONTROL;
8084 EP_CONTROL_t EP6_IN_CONTROL;
8085 EP_CONTROL_t EP6_OUT_CONTROL;
8086 EP_CONTROL_t EP7_IN_CONTROL;
8087 EP_CONTROL_t EP7_OUT_CONTROL;
8088 EP_CONTROL_t EP8_IN_CONTROL;
8089 EP_CONTROL_t EP8_OUT_CONTROL;
8090 EP_CONTROL_t EP9_IN_CONTROL;
8091 EP_CONTROL_t EP9_OUT_CONTROL;
8092 EP_CONTROL_t EP10_IN_CONTROL;
8093 EP_CONTROL_t EP10_OUT_CONTROL;
8094 EP_CONTROL_t EP11_IN_CONTROL;
8095 EP_CONTROL_t EP11_OUT_CONTROL;
8096 EP_CONTROL_t EP12_IN_CONTROL;
8097 EP_CONTROL_t EP12_OUT_CONTROL;
8098 EP_CONTROL_t EP13_IN_CONTROL;
8099 EP_CONTROL_t EP13_OUT_CONTROL;
8100 EP_CONTROL_t EP14_IN_CONTROL;
8101 EP_CONTROL_t EP14_OUT_CONTROL;
8102 EP_CONTROL_t EP15_IN_CONTROL;
8103 EP_CONTROL_t EP15_OUT_CONTROL;
8104 EP_BUFFER_CONTROL_t EP0_IN_BUFFER_CONTROL;
8105 EP_BUFFER_CONTROL_t EP0_OUT_BUFFER_CONTROL;
8106 EP_BUFFER_CONTROL_t EP1_IN_BUFFER_CONTROL;
8107 EP_BUFFER_CONTROL_t EP1_OUT_BUFFER_CONTROL;
8108 EP_BUFFER_CONTROL_t EP2_IN_BUFFER_CONTROL;
8109 EP_BUFFER_CONTROL_t EP2_OUT_BUFFER_CONTROL;
8110 EP_BUFFER_CONTROL_t EP3_IN_BUFFER_CONTROL;
8111 EP_BUFFER_CONTROL_t EP3_OUT_BUFFER_CONTROL;
8112 EP_BUFFER_CONTROL_t EP4_IN_BUFFER_CONTROL;
8113 EP_BUFFER_CONTROL_t EP4_OUT_BUFFER_CONTROL;
8114 EP_BUFFER_CONTROL_t EP5_IN_BUFFER_CONTROL;
8115 EP_BUFFER_CONTROL_t EP5_OUT_BUFFER_CONTROL;
8116 EP_BUFFER_CONTROL_t EP6_IN_BUFFER_CONTROL;
8117 EP_BUFFER_CONTROL_t EP6_OUT_BUFFER_CONTROL;
8118 EP_BUFFER_CONTROL_t EP7_IN_BUFFER_CONTROL;
8119 EP_BUFFER_CONTROL_t EP7_OUT_BUFFER_CONTROL;
8120 EP_BUFFER_CONTROL_t EP8_IN_BUFFER_CONTROL;
8121 EP_BUFFER_CONTROL_t EP8_OUT_BUFFER_CONTROL;
8122 EP_BUFFER_CONTROL_t EP9_IN_BUFFER_CONTROL;
8123 EP_BUFFER_CONTROL_t EP9_OUT_BUFFER_CONTROL;
8124 EP_BUFFER_CONTROL_t EP10_IN_BUFFER_CONTROL;
8125 EP_BUFFER_CONTROL_t EP10_OUT_BUFFER_CONTROL;
8126 EP_BUFFER_CONTROL_t EP11_IN_BUFFER_CONTROL;
8127 EP_BUFFER_CONTROL_t EP11_OUT_BUFFER_CONTROL;
8128 EP_BUFFER_CONTROL_t EP12_IN_BUFFER_CONTROL;
8129 EP_BUFFER_CONTROL_t EP12_OUT_BUFFER_CONTROL;
8130 EP_BUFFER_CONTROL_t EP13_IN_BUFFER_CONTROL;
8131 EP_BUFFER_CONTROL_t EP13_OUT_BUFFER_CONTROL;
8132 EP_BUFFER_CONTROL_t EP14_IN_BUFFER_CONTROL;
8133 EP_BUFFER_CONTROL_t EP14_OUT_BUFFER_CONTROL;
8134 EP_BUFFER_CONTROL_t EP15_IN_BUFFER_CONTROL;
8135 EP_BUFFER_CONTROL_t EP15_OUT_BUFFER_CONTROL;
8136 };
8137
8138 static USBCTRL_DPRAM_t & USBCTRL_DPRAM = (*(USBCTRL_DPRAM_t *)0x50100000);
8139 static USBCTRL_DPRAM_t & USBCTRL_DPRAM_XOR = (*(USBCTRL_DPRAM_t *)0x50101000);
8140 static USBCTRL_DPRAM_t & USBCTRL_DPRAM_SET = (*(USBCTRL_DPRAM_t *)0x50102000);
8141 static USBCTRL_DPRAM_t & USBCTRL_DPRAM_CLR = (*(USBCTRL_DPRAM_t *)0x50103000);
8142
8143} // _USBCTRL_DPRAM_
8144
8145// USB FS/LS controller device registers
8146namespace _USBCTRL_REGS_ {
8147
8148 // Device address and endpoint control
8149 // Reset value: 0x00000000
8150 BEGIN_TYPE(ADDR_ENDP_t, uint32_t)
8151 // Device endpoint to send data to. Only valid for HOST mode.
8152 ADD_BITFIELD_RW(ENDPOINT, 16, 4)
8153 // In device mode, the address that the device should respond to. Set in response to a SET_ADDR setup packet from the host. In host mode set to the address of the device to communicate with.
8154 ADD_BITFIELD_RW(ADDRESS, 0, 7)
8155 END_TYPE()
8156
8157 // Interrupt endpoint 1. Only valid for HOST mode.
8158 // Reset value: 0x00000000
8159 BEGIN_TYPE(ADDR_ENDP__t, uint32_t)
8160 // Interrupt EP requires preamble (is a low speed device on a full speed hub)
8161 ADD_BITFIELD_RW(INTEP_PREAMBLE, 26, 1)
8162 // Direction of the interrupt endpoint. In=0, Out=1
8163 ADD_BITFIELD_RW(INTEP_DIR, 25, 1)
8164 // Endpoint number of the interrupt endpoint
8165 ADD_BITFIELD_RW(ENDPOINT, 16, 4)
8166 // Device address
8167 ADD_BITFIELD_RW(ADDRESS, 0, 7)
8168 END_TYPE()
8169
8170 // Main control register
8171 // Reset value: 0x00000000
8172 BEGIN_TYPE(MAIN_CTRL_t, uint32_t)
8173 // Reduced timings for simulation
8174 ADD_BITFIELD_RW(SIM_TIMING, 31, 1)
8175 // Device mode = 0, Host mode = 1
8176 ADD_BITFIELD_RW(HOST_NDEVICE, 1, 1)
8177 // Enable controller
8178 ADD_BITFIELD_RW(CONTROLLER_EN, 0, 1)
8179 END_TYPE()
8180
8181 // Set the SOF (Start of Frame) frame number in the host controller. The SOF packet is sent every 1ms and the host will increment the frame number by 1 each time.
8182 // Reset value: 0x00000000
8183 BEGIN_TYPE(SOF_WR_t, uint32_t)
8184 ADD_BITFIELD_WO(COUNT, 0, 11)
8185 END_TYPE()
8186
8187 // Read the last SOF (Start of Frame) frame number seen. In device mode the last SOF received from the host. In host mode the last SOF sent by the host.
8188 // Reset value: 0x00000000
8189 BEGIN_TYPE(SOF_RD_t, uint32_t)
8190 ADD_BITFIELD_RO(COUNT, 0, 11)
8191 END_TYPE()
8192
8193 // SIE control register
8194 // Reset value: 0x00000000
8195 BEGIN_TYPE(SIE_CTRL_t, uint32_t)
8196 // Device: Set bit in EP_STATUS_STALL_NAK when EP0 sends a STALL
8197 ADD_BITFIELD_RW(EP0_INT_STALL, 31, 1)
8198 // Device: EP0 single buffered = 0, double buffered = 1
8199 ADD_BITFIELD_RW(EP0_DOUBLE_BUF, 30, 1)
8200 // Device: Set bit in BUFF_STATUS for every buffer completed on EP0
8201 ADD_BITFIELD_RW(EP0_INT_1BUF, 29, 1)
8202 // Device: Set bit in BUFF_STATUS for every 2 buffers completed on EP0
8203 ADD_BITFIELD_RW(EP0_INT_2BUF, 28, 1)
8204 // Device: Set bit in EP_STATUS_STALL_NAK when EP0 sends a NAK
8205 ADD_BITFIELD_RW(EP0_INT_NAK, 27, 1)
8206 // Direct bus drive enable
8207 ADD_BITFIELD_RW(DIRECT_EN, 26, 1)
8208 // Direct control of DP
8209 ADD_BITFIELD_RW(DIRECT_DP, 25, 1)
8210 // Direct control of DM
8211 ADD_BITFIELD_RW(DIRECT_DM, 24, 1)
8212 // Power down bus transceiver
8213 ADD_BITFIELD_RW(TRANSCEIVER_PD, 18, 1)
8214 // Device: Pull-up strength (0=1K2, 1=2k3)
8215 ADD_BITFIELD_RW(RPU_OPT, 17, 1)
8216 // Device: Enable pull up resistor
8217 ADD_BITFIELD_RW(PULLUP_EN, 16, 1)
8218 // Host: Enable pull down resistors
8219 ADD_BITFIELD_RW(PULLDOWN_EN, 15, 1)
8220 // Host: Reset bus
8221 ADD_BITFIELD_RW(RESET_BUS, 13, 1)
8222 // Device: Remote wakeup. Device can initiate its own resume after suspend.
8223 ADD_BITFIELD_RW(RESUME, 12, 1)
8224 // Host: Enable VBUS
8225 ADD_BITFIELD_RW(VBUS_EN, 11, 1)
8226 // Host: Enable keep alive packet (for low speed bus)
8227 ADD_BITFIELD_RW(KEEP_ALIVE_EN, 10, 1)
8228 // Host: Enable SOF generation (for full speed bus)
8229 ADD_BITFIELD_RW(SOF_EN, 9, 1)
8230 // Host: Delay packet(s) until after SOF
8231 ADD_BITFIELD_RW(SOF_SYNC, 8, 1)
8232 // Host: Preable enable for LS device on FS hub
8233 ADD_BITFIELD_RW(PREAMBLE_EN, 6, 1)
8234 // Host: Stop transaction
8235 ADD_BITFIELD_RW(STOP_TRANS, 4, 1)
8236 // Host: Receive transaction (IN to host)
8237 ADD_BITFIELD_RW(RECEIVE_DATA, 3, 1)
8238 // Host: Send transaction (OUT from host)
8239 ADD_BITFIELD_RW(SEND_DATA, 2, 1)
8240 // Host: Send Setup packet
8241 ADD_BITFIELD_RW(SEND_SETUP, 1, 1)
8242 // Host: Start transaction
8243 ADD_BITFIELD_RW(START_TRANS, 0, 1)
8244 END_TYPE()
8245
8246 // SIE status register
8247 // Reset value: 0x00000000
8248 BEGIN_TYPE(SIE_STATUS_t, uint32_t)
8249 // Data Sequence Error.
8250 //
8251 // The device can raise a sequence error in the following conditions:
8252 //
8253 // * A SETUP packet is received followed by a DATA1 packet (data phase should always be DATA0) * An OUT packet is received from the host but doesn't match the data pid in the buffer control register read from DPSRAM
8254 //
8255 // The host can raise a data sequence error in the following conditions:
8256 //
8257 // * An IN packet from the device has the wrong data PID
8258 ADD_BITFIELD_RW(DATA_SEQ_ERROR, 31, 1)
8259 // ACK received. Raised by both host and device.
8260 ADD_BITFIELD_RW(ACK_REC, 30, 1)
8261 // Host: STALL received
8262 ADD_BITFIELD_RW(STALL_REC, 29, 1)
8263 // Host: NAK received
8264 ADD_BITFIELD_RW(NAK_REC, 28, 1)
8265 // RX timeout is raised by both the host and device if an ACK is not received in the maximum time specified by the USB spec.
8266 ADD_BITFIELD_RW(RX_TIMEOUT, 27, 1)
8267 // RX overflow is raised by the Serial RX engine if the incoming data is too fast.
8268 ADD_BITFIELD_RW(RX_OVERFLOW, 26, 1)
8269 // Bit Stuff Error. Raised by the Serial RX engine.
8270 ADD_BITFIELD_RW(BIT_STUFF_ERROR, 25, 1)
8271 // CRC Error. Raised by the Serial RX engine.
8272 ADD_BITFIELD_RW(CRC_ERROR, 24, 1)
8273 // Device: bus reset received
8274 ADD_BITFIELD_RW(BUS_RESET, 19, 1)
8275 // Transaction complete.
8276 //
8277 // Raised by device if:
8278 //
8279 // * An IN or OUT packet is sent with the `LAST_BUFF` bit set in the buffer control register
8280 //
8281 // Raised by host if:
8282 //
8283 // * A setup packet is sent when no data in or data out transaction follows * An IN packet is received and the `LAST_BUFF` bit is set in the buffer control register * An IN packet is received with zero length * An OUT packet is sent and the `LAST_BUFF` bit is set
8284 ADD_BITFIELD_RW(TRANS_COMPLETE, 18, 1)
8285 // Device: Setup packet received
8286 ADD_BITFIELD_RW(SETUP_REC, 17, 1)
8287 // Device: connected
8288 ADD_BITFIELD_RW(CONNECTED, 16, 1)
8289 // Host: Device has initiated a remote resume. Device: host has initiated a resume.
8290 ADD_BITFIELD_RW(RESUME, 11, 1)
8291 // VBUS over current detected
8292 ADD_BITFIELD_RO(VBUS_OVER_CURR, 10, 1)
8293 // Host: device speed. Disconnected = 00, LS = 01, FS = 10
8294 ADD_BITFIELD_RW(SPEED, 8, 2)
8295 // Bus in suspended state. Valid for device and host. Host and device will go into suspend if neither Keep Alive / SOF frames are enabled.
8296 ADD_BITFIELD_RW(SUSPENDED, 4, 1)
8297 // USB bus line state
8298 ADD_BITFIELD_RO(LINE_STATE, 2, 2)
8299 // Device: VBUS Detected
8300 ADD_BITFIELD_RO(VBUS_DETECTED, 0, 1)
8301 END_TYPE()
8302
8303 // interrupt endpoint control register
8304 // Reset value: 0x00000000
8305 BEGIN_TYPE(INT_EP_CTRL_t, uint32_t)
8306 // Host: Enable interrupt endpoint 1 -> 15
8307 ADD_BITFIELD_RW(INT_EP_ACTIVE, 1, 15)
8308 END_TYPE()
8309
8310 // Buffer status register. A bit set here indicates that a buffer has completed on the endpoint (if the buffer interrupt is enabled). It is possible for 2 buffers to be completed, so clearing the buffer status bit may instantly re set it on the next clock cycle.
8311 // Reset value: 0x00000000
8312 BEGIN_TYPE(BUFF_STATUS_t, uint32_t)
8313 ADD_BITFIELD_RW(EP15_OUT, 31, 1)
8314 ADD_BITFIELD_RW(EP15_IN, 30, 1)
8315 ADD_BITFIELD_RW(EP14_OUT, 29, 1)
8316 ADD_BITFIELD_RW(EP14_IN, 28, 1)
8317 ADD_BITFIELD_RW(EP13_OUT, 27, 1)
8318 ADD_BITFIELD_RW(EP13_IN, 26, 1)
8319 ADD_BITFIELD_RW(EP12_OUT, 25, 1)
8320 ADD_BITFIELD_RW(EP12_IN, 24, 1)
8321 ADD_BITFIELD_RW(EP11_OUT, 23, 1)
8322 ADD_BITFIELD_RW(EP11_IN, 22, 1)
8323 ADD_BITFIELD_RW(EP10_OUT, 21, 1)
8324 ADD_BITFIELD_RW(EP10_IN, 20, 1)
8325 ADD_BITFIELD_RW(EP9_OUT, 19, 1)
8326 ADD_BITFIELD_RW(EP9_IN, 18, 1)
8327 ADD_BITFIELD_RW(EP8_OUT, 17, 1)
8328 ADD_BITFIELD_RW(EP8_IN, 16, 1)
8329 ADD_BITFIELD_RW(EP7_OUT, 15, 1)
8330 ADD_BITFIELD_RW(EP7_IN, 14, 1)
8331 ADD_BITFIELD_RW(EP6_OUT, 13, 1)
8332 ADD_BITFIELD_RW(EP6_IN, 12, 1)
8333 ADD_BITFIELD_RW(EP5_OUT, 11, 1)
8334 ADD_BITFIELD_RW(EP5_IN, 10, 1)
8335 ADD_BITFIELD_RW(EP4_OUT, 9, 1)
8336 ADD_BITFIELD_RW(EP4_IN, 8, 1)
8337 ADD_BITFIELD_RW(EP3_OUT, 7, 1)
8338 ADD_BITFIELD_RW(EP3_IN, 6, 1)
8339 ADD_BITFIELD_RW(EP2_OUT, 5, 1)
8340 ADD_BITFIELD_RW(EP2_IN, 4, 1)
8341 ADD_BITFIELD_RW(EP1_OUT, 3, 1)
8342 ADD_BITFIELD_RW(EP1_IN, 2, 1)
8343 ADD_BITFIELD_RW(EP0_OUT, 1, 1)
8344 ADD_BITFIELD_RW(EP0_IN, 0, 1)
8345 END_TYPE()
8346
8347 // Which of the double buffers should be handled. Only valid if using an interrupt per buffer (i.e. not per 2 buffers). Not valid for host interrupt endpoint polling because they are only single buffered.
8348 // Reset value: 0x00000000
8349 BEGIN_TYPE(BUFF_CPU_SHOULD_HANDLE_t, uint32_t)
8350 ADD_BITFIELD_RO(EP15_OUT, 31, 1)
8351 ADD_BITFIELD_RO(EP15_IN, 30, 1)
8352 ADD_BITFIELD_RO(EP14_OUT, 29, 1)
8353 ADD_BITFIELD_RO(EP14_IN, 28, 1)
8354 ADD_BITFIELD_RO(EP13_OUT, 27, 1)
8355 ADD_BITFIELD_RO(EP13_IN, 26, 1)
8356 ADD_BITFIELD_RO(EP12_OUT, 25, 1)
8357 ADD_BITFIELD_RO(EP12_IN, 24, 1)
8358 ADD_BITFIELD_RO(EP11_OUT, 23, 1)
8359 ADD_BITFIELD_RO(EP11_IN, 22, 1)
8360 ADD_BITFIELD_RO(EP10_OUT, 21, 1)
8361 ADD_BITFIELD_RO(EP10_IN, 20, 1)
8362 ADD_BITFIELD_RO(EP9_OUT, 19, 1)
8363 ADD_BITFIELD_RO(EP9_IN, 18, 1)
8364 ADD_BITFIELD_RO(EP8_OUT, 17, 1)
8365 ADD_BITFIELD_RO(EP8_IN, 16, 1)
8366 ADD_BITFIELD_RO(EP7_OUT, 15, 1)
8367 ADD_BITFIELD_RO(EP7_IN, 14, 1)
8368 ADD_BITFIELD_RO(EP6_OUT, 13, 1)
8369 ADD_BITFIELD_RO(EP6_IN, 12, 1)
8370 ADD_BITFIELD_RO(EP5_OUT, 11, 1)
8371 ADD_BITFIELD_RO(EP5_IN, 10, 1)
8372 ADD_BITFIELD_RO(EP4_OUT, 9, 1)
8373 ADD_BITFIELD_RO(EP4_IN, 8, 1)
8374 ADD_BITFIELD_RO(EP3_OUT, 7, 1)
8375 ADD_BITFIELD_RO(EP3_IN, 6, 1)
8376 ADD_BITFIELD_RO(EP2_OUT, 5, 1)
8377 ADD_BITFIELD_RO(EP2_IN, 4, 1)
8378 ADD_BITFIELD_RO(EP1_OUT, 3, 1)
8379 ADD_BITFIELD_RO(EP1_IN, 2, 1)
8380 ADD_BITFIELD_RO(EP0_OUT, 1, 1)
8381 ADD_BITFIELD_RO(EP0_IN, 0, 1)
8382 END_TYPE()
8383
8384 // Device only: Can be set to ignore the buffer control register for this endpoint in case you would like to revoke a buffer. A NAK will be sent for every access to the endpoint until this bit is cleared. A corresponding bit in `EP_ABORT_DONE` is set when it is safe to modify the buffer control register.
8385 // Reset value: 0x00000000
8386 BEGIN_TYPE(EP_ABORT_t, uint32_t)
8387 ADD_BITFIELD_RW(EP15_OUT, 31, 1)
8388 ADD_BITFIELD_RW(EP15_IN, 30, 1)
8389 ADD_BITFIELD_RW(EP14_OUT, 29, 1)
8390 ADD_BITFIELD_RW(EP14_IN, 28, 1)
8391 ADD_BITFIELD_RW(EP13_OUT, 27, 1)
8392 ADD_BITFIELD_RW(EP13_IN, 26, 1)
8393 ADD_BITFIELD_RW(EP12_OUT, 25, 1)
8394 ADD_BITFIELD_RW(EP12_IN, 24, 1)
8395 ADD_BITFIELD_RW(EP11_OUT, 23, 1)
8396 ADD_BITFIELD_RW(EP11_IN, 22, 1)
8397 ADD_BITFIELD_RW(EP10_OUT, 21, 1)
8398 ADD_BITFIELD_RW(EP10_IN, 20, 1)
8399 ADD_BITFIELD_RW(EP9_OUT, 19, 1)
8400 ADD_BITFIELD_RW(EP9_IN, 18, 1)
8401 ADD_BITFIELD_RW(EP8_OUT, 17, 1)
8402 ADD_BITFIELD_RW(EP8_IN, 16, 1)
8403 ADD_BITFIELD_RW(EP7_OUT, 15, 1)
8404 ADD_BITFIELD_RW(EP7_IN, 14, 1)
8405 ADD_BITFIELD_RW(EP6_OUT, 13, 1)
8406 ADD_BITFIELD_RW(EP6_IN, 12, 1)
8407 ADD_BITFIELD_RW(EP5_OUT, 11, 1)
8408 ADD_BITFIELD_RW(EP5_IN, 10, 1)
8409 ADD_BITFIELD_RW(EP4_OUT, 9, 1)
8410 ADD_BITFIELD_RW(EP4_IN, 8, 1)
8411 ADD_BITFIELD_RW(EP3_OUT, 7, 1)
8412 ADD_BITFIELD_RW(EP3_IN, 6, 1)
8413 ADD_BITFIELD_RW(EP2_OUT, 5, 1)
8414 ADD_BITFIELD_RW(EP2_IN, 4, 1)
8415 ADD_BITFIELD_RW(EP1_OUT, 3, 1)
8416 ADD_BITFIELD_RW(EP1_IN, 2, 1)
8417 ADD_BITFIELD_RW(EP0_OUT, 1, 1)
8418 ADD_BITFIELD_RW(EP0_IN, 0, 1)
8419 END_TYPE()
8420
8421 // Device only: Used in conjunction with `EP_ABORT`. Set once an endpoint is idle so the programmer knows it is safe to modify the buffer control register.
8422 // Reset value: 0x00000000
8423 BEGIN_TYPE(EP_ABORT_DONE_t, uint32_t)
8424 ADD_BITFIELD_RW(EP15_OUT, 31, 1)
8425 ADD_BITFIELD_RW(EP15_IN, 30, 1)
8426 ADD_BITFIELD_RW(EP14_OUT, 29, 1)
8427 ADD_BITFIELD_RW(EP14_IN, 28, 1)
8428 ADD_BITFIELD_RW(EP13_OUT, 27, 1)
8429 ADD_BITFIELD_RW(EP13_IN, 26, 1)
8430 ADD_BITFIELD_RW(EP12_OUT, 25, 1)
8431 ADD_BITFIELD_RW(EP12_IN, 24, 1)
8432 ADD_BITFIELD_RW(EP11_OUT, 23, 1)
8433 ADD_BITFIELD_RW(EP11_IN, 22, 1)
8434 ADD_BITFIELD_RW(EP10_OUT, 21, 1)
8435 ADD_BITFIELD_RW(EP10_IN, 20, 1)
8436 ADD_BITFIELD_RW(EP9_OUT, 19, 1)
8437 ADD_BITFIELD_RW(EP9_IN, 18, 1)
8438 ADD_BITFIELD_RW(EP8_OUT, 17, 1)
8439 ADD_BITFIELD_RW(EP8_IN, 16, 1)
8440 ADD_BITFIELD_RW(EP7_OUT, 15, 1)
8441 ADD_BITFIELD_RW(EP7_IN, 14, 1)
8442 ADD_BITFIELD_RW(EP6_OUT, 13, 1)
8443 ADD_BITFIELD_RW(EP6_IN, 12, 1)
8444 ADD_BITFIELD_RW(EP5_OUT, 11, 1)
8445 ADD_BITFIELD_RW(EP5_IN, 10, 1)
8446 ADD_BITFIELD_RW(EP4_OUT, 9, 1)
8447 ADD_BITFIELD_RW(EP4_IN, 8, 1)
8448 ADD_BITFIELD_RW(EP3_OUT, 7, 1)
8449 ADD_BITFIELD_RW(EP3_IN, 6, 1)
8450 ADD_BITFIELD_RW(EP2_OUT, 5, 1)
8451 ADD_BITFIELD_RW(EP2_IN, 4, 1)
8452 ADD_BITFIELD_RW(EP1_OUT, 3, 1)
8453 ADD_BITFIELD_RW(EP1_IN, 2, 1)
8454 ADD_BITFIELD_RW(EP0_OUT, 1, 1)
8455 ADD_BITFIELD_RW(EP0_IN, 0, 1)
8456 END_TYPE()
8457
8458 // Device: this bit must be set in conjunction with the `STALL` bit in the buffer control register to send a STALL on EP0. The device controller clears these bits when a SETUP packet is received because the USB spec requires that a STALL condition is cleared when a SETUP packet is received.
8459 // Reset value: 0x00000000
8460 BEGIN_TYPE(EP_STALL_ARM_t, uint32_t)
8461 ADD_BITFIELD_RW(EP0_OUT, 1, 1)
8462 ADD_BITFIELD_RW(EP0_IN, 0, 1)
8463 END_TYPE()
8464
8465 // Used by the host controller. Sets the wait time in microseconds before trying again if the device replies with a NAK.
8466 // Reset value: 0x00100010
8467 BEGIN_TYPE(NAK_POLL_t, uint32_t)
8468 // NAK polling interval for a full speed device
8469 ADD_BITFIELD_RW(DELAY_FS, 16, 10)
8470 // NAK polling interval for a low speed device
8471 ADD_BITFIELD_RW(DELAY_LS, 0, 10)
8472 END_TYPE()
8473
8474 // Device: bits are set when the `IRQ_ON_NAK` or `IRQ_ON_STALL` bits are set. For EP0 this comes from `SIE_CTRL`. For all other endpoints it comes from the endpoint control register.
8475 // Reset value: 0x00000000
8476 BEGIN_TYPE(EP_STATUS_STALL_NAK_t, uint32_t)
8477 ADD_BITFIELD_RW(EP15_OUT, 31, 1)
8478 ADD_BITFIELD_RW(EP15_IN, 30, 1)
8479 ADD_BITFIELD_RW(EP14_OUT, 29, 1)
8480 ADD_BITFIELD_RW(EP14_IN, 28, 1)
8481 ADD_BITFIELD_RW(EP13_OUT, 27, 1)
8482 ADD_BITFIELD_RW(EP13_IN, 26, 1)
8483 ADD_BITFIELD_RW(EP12_OUT, 25, 1)
8484 ADD_BITFIELD_RW(EP12_IN, 24, 1)
8485 ADD_BITFIELD_RW(EP11_OUT, 23, 1)
8486 ADD_BITFIELD_RW(EP11_IN, 22, 1)
8487 ADD_BITFIELD_RW(EP10_OUT, 21, 1)
8488 ADD_BITFIELD_RW(EP10_IN, 20, 1)
8489 ADD_BITFIELD_RW(EP9_OUT, 19, 1)
8490 ADD_BITFIELD_RW(EP9_IN, 18, 1)
8491 ADD_BITFIELD_RW(EP8_OUT, 17, 1)
8492 ADD_BITFIELD_RW(EP8_IN, 16, 1)
8493 ADD_BITFIELD_RW(EP7_OUT, 15, 1)
8494 ADD_BITFIELD_RW(EP7_IN, 14, 1)
8495 ADD_BITFIELD_RW(EP6_OUT, 13, 1)
8496 ADD_BITFIELD_RW(EP6_IN, 12, 1)
8497 ADD_BITFIELD_RW(EP5_OUT, 11, 1)
8498 ADD_BITFIELD_RW(EP5_IN, 10, 1)
8499 ADD_BITFIELD_RW(EP4_OUT, 9, 1)
8500 ADD_BITFIELD_RW(EP4_IN, 8, 1)
8501 ADD_BITFIELD_RW(EP3_OUT, 7, 1)
8502 ADD_BITFIELD_RW(EP3_IN, 6, 1)
8503 ADD_BITFIELD_RW(EP2_OUT, 5, 1)
8504 ADD_BITFIELD_RW(EP2_IN, 4, 1)
8505 ADD_BITFIELD_RW(EP1_OUT, 3, 1)
8506 ADD_BITFIELD_RW(EP1_IN, 2, 1)
8507 ADD_BITFIELD_RW(EP0_OUT, 1, 1)
8508 ADD_BITFIELD_RW(EP0_IN, 0, 1)
8509 END_TYPE()
8510
8511 // Where to connect the USB controller. Should be to_phy by default.
8512 // Reset value: 0x00000000
8513 BEGIN_TYPE(USB_MUXING_t, uint32_t)
8514 ADD_BITFIELD_RW(SOFTCON, 3, 1)
8515 ADD_BITFIELD_RW(TO_DIGITAL_PAD, 2, 1)
8516 ADD_BITFIELD_RW(TO_EXTPHY, 1, 1)
8517 ADD_BITFIELD_RW(TO_PHY, 0, 1)
8518 END_TYPE()
8519
8520 // Overrides for the power signals in the event that the VBUS signals are not hooked up to GPIO. Set the value of the override and then the override enable to switch over to the override value.
8521 // Reset value: 0x00000000
8522 BEGIN_TYPE(USB_PWR_t, uint32_t)
8523 ADD_BITFIELD_RW(OVERCURR_DETECT_EN, 5, 1)
8524 ADD_BITFIELD_RW(OVERCURR_DETECT, 4, 1)
8525 ADD_BITFIELD_RW(VBUS_DETECT_OVERRIDE_EN, 3, 1)
8526 ADD_BITFIELD_RW(VBUS_DETECT, 2, 1)
8527 ADD_BITFIELD_RW(VBUS_EN_OVERRIDE_EN, 1, 1)
8528 ADD_BITFIELD_RW(VBUS_EN, 0, 1)
8529 END_TYPE()
8530
8531 // This register allows for direct control of the USB phy. Use in conjunction with usbphy_direct_override register to enable each override bit.
8532 // Reset value: 0x00000000
8533 BEGIN_TYPE(USBPHY_DIRECT_t, uint32_t)
8534 // DM over voltage
8535 ADD_BITFIELD_RO(DM_OVV, 22, 1)
8536 // DP over voltage
8537 ADD_BITFIELD_RO(DP_OVV, 21, 1)
8538 // DM overcurrent
8539 ADD_BITFIELD_RO(DM_OVCN, 20, 1)
8540 // DP overcurrent
8541 ADD_BITFIELD_RO(DP_OVCN, 19, 1)
8542 // DPM pin state
8543 ADD_BITFIELD_RO(RX_DM, 18, 1)
8544 // DPP pin state
8545 ADD_BITFIELD_RO(RX_DP, 17, 1)
8546 // Differential RX
8547 ADD_BITFIELD_RO(RX_DD, 16, 1)
8548 // TX_DIFFMODE=0: Single ended mode
8549 // TX_DIFFMODE=1: Differential drive mode (TX_DM, TX_DM_OE ignored)
8550 ADD_BITFIELD_RW(TX_DIFFMODE, 15, 1)
8551 // TX_FSSLEW=0: Low speed slew rate
8552 // TX_FSSLEW=1: Full speed slew rate
8553 ADD_BITFIELD_RW(TX_FSSLEW, 14, 1)
8554 // TX power down override (if override enable is set). 1 = powered down.
8555 ADD_BITFIELD_RW(TX_PD, 13, 1)
8556 // RX power down override (if override enable is set). 1 = powered down.
8557 ADD_BITFIELD_RW(RX_PD, 12, 1)
8558 // Output data. TX_DIFFMODE=1, Ignored
8559 // TX_DIFFMODE=0, Drives DPM only. TX_DM_OE=1 to enable drive. DPM=TX_DM
8560 ADD_BITFIELD_RW(TX_DM, 11, 1)
8561 // Output data. If TX_DIFFMODE=1, Drives DPP/DPM diff pair. TX_DP_OE=1 to enable drive. DPP=TX_DP, DPM=~TX_DP
8562 // If TX_DIFFMODE=0, Drives DPP only. TX_DP_OE=1 to enable drive. DPP=TX_DP
8563 ADD_BITFIELD_RW(TX_DP, 10, 1)
8564 // Output enable. If TX_DIFFMODE=1, Ignored.
8565 // If TX_DIFFMODE=0, OE for DPM only. 0 - DPM in Hi-Z state; 1 - DPM driving
8566 ADD_BITFIELD_RW(TX_DM_OE, 9, 1)
8567 // Output enable. If TX_DIFFMODE=1, OE for DPP/DPM diff pair. 0 - DPP/DPM in Hi-Z state; 1 - DPP/DPM driving
8568 // If TX_DIFFMODE=0, OE for DPP only. 0 - DPP in Hi-Z state; 1 - DPP driving
8569 ADD_BITFIELD_RW(TX_DP_OE, 8, 1)
8570 // DM pull down enable
8571 ADD_BITFIELD_RW(DM_PULLDN_EN, 6, 1)
8572 // DM pull up enable
8573 ADD_BITFIELD_RW(DM_PULLUP_EN, 5, 1)
8574 // Enable the second DM pull up resistor. 0 - Pull = Rpu2; 1 - Pull = Rpu1 + Rpu2
8575 ADD_BITFIELD_RW(DM_PULLUP_HISEL, 4, 1)
8576 // DP pull down enable
8577 ADD_BITFIELD_RW(DP_PULLDN_EN, 2, 1)
8578 // DP pull up enable
8579 ADD_BITFIELD_RW(DP_PULLUP_EN, 1, 1)
8580 // Enable the second DP pull up resistor. 0 - Pull = Rpu2; 1 - Pull = Rpu1 + Rpu2
8581 ADD_BITFIELD_RW(DP_PULLUP_HISEL, 0, 1)
8582 END_TYPE()
8583
8584 // Override enable for each control in usbphy_direct
8585 // Reset value: 0x00000000
8586 BEGIN_TYPE(USBPHY_DIRECT_OVERRIDE_t, uint32_t)
8587 ADD_BITFIELD_RW(TX_DIFFMODE_OVERRIDE_EN, 15, 1)
8588 ADD_BITFIELD_RW(DM_PULLUP_OVERRIDE_EN, 12, 1)
8589 ADD_BITFIELD_RW(TX_FSSLEW_OVERRIDE_EN, 11, 1)
8590 ADD_BITFIELD_RW(TX_PD_OVERRIDE_EN, 10, 1)
8591 ADD_BITFIELD_RW(RX_PD_OVERRIDE_EN, 9, 1)
8592 ADD_BITFIELD_RW(TX_DM_OVERRIDE_EN, 8, 1)
8593 ADD_BITFIELD_RW(TX_DP_OVERRIDE_EN, 7, 1)
8594 ADD_BITFIELD_RW(TX_DM_OE_OVERRIDE_EN, 6, 1)
8595 ADD_BITFIELD_RW(TX_DP_OE_OVERRIDE_EN, 5, 1)
8596 ADD_BITFIELD_RW(DM_PULLDN_EN_OVERRIDE_EN, 4, 1)
8597 ADD_BITFIELD_RW(DP_PULLDN_EN_OVERRIDE_EN, 3, 1)
8598 ADD_BITFIELD_RW(DP_PULLUP_EN_OVERRIDE_EN, 2, 1)
8599 ADD_BITFIELD_RW(DM_PULLUP_HISEL_OVERRIDE_EN, 1, 1)
8600 ADD_BITFIELD_RW(DP_PULLUP_HISEL_OVERRIDE_EN, 0, 1)
8601 END_TYPE()
8602
8603 // Used to adjust trim values of USB phy pull down resistors.
8604 // Reset value: 0x00001f1f
8605 BEGIN_TYPE(USBPHY_TRIM_t, uint32_t)
8606 // Value to drive to USB PHY
8607 // DM pulldown resistor trim control
8608 // Experimental data suggests that the reset value will work, but this register allows adjustment if required
8609 ADD_BITFIELD_RW(DM_PULLDN_TRIM, 8, 5)
8610 // Value to drive to USB PHY
8611 // DP pulldown resistor trim control
8612 // Experimental data suggests that the reset value will work, but this register allows adjustment if required
8613 ADD_BITFIELD_RW(DP_PULLDN_TRIM, 0, 5)
8614 END_TYPE()
8615
8616 // Raw Interrupts
8617 // Reset value: 0x00000000
8618 BEGIN_TYPE(INTR_t, uint32_t)
8619 // Raised when any bit in EP_STATUS_STALL_NAK is set. Clear by clearing all bits in EP_STATUS_STALL_NAK.
8620 ADD_BITFIELD_RO(EP_STALL_NAK, 19, 1)
8621 // Raised when any bit in ABORT_DONE is set. Clear by clearing all bits in ABORT_DONE.
8622 ADD_BITFIELD_RO(ABORT_DONE, 18, 1)
8623 // Set every time the device receives a SOF (Start of Frame) packet. Cleared by reading SOF_RD
8624 ADD_BITFIELD_RO(DEV_SOF, 17, 1)
8625 // Device. Source: SIE_STATUS.SETUP_REC
8626 ADD_BITFIELD_RO(SETUP_REQ, 16, 1)
8627 // Set when the device receives a resume from the host. Cleared by writing to SIE_STATUS.RESUME
8628 ADD_BITFIELD_RO(DEV_RESUME_FROM_HOST, 15, 1)
8629 // Set when the device suspend state changes. Cleared by writing to SIE_STATUS.SUSPENDED
8630 ADD_BITFIELD_RO(DEV_SUSPEND, 14, 1)
8631 // Set when the device connection state changes. Cleared by writing to SIE_STATUS.CONNECTED
8632 ADD_BITFIELD_RO(DEV_CONN_DIS, 13, 1)
8633 // Source: SIE_STATUS.BUS_RESET
8634 ADD_BITFIELD_RO(BUS_RESET, 12, 1)
8635 // Source: SIE_STATUS.VBUS_DETECTED
8636 ADD_BITFIELD_RO(VBUS_DETECT, 11, 1)
8637 // Source: SIE_STATUS.STALL_REC
8638 ADD_BITFIELD_RO(STALL, 10, 1)
8639 // Source: SIE_STATUS.CRC_ERROR
8640 ADD_BITFIELD_RO(ERROR_CRC, 9, 1)
8641 // Source: SIE_STATUS.BIT_STUFF_ERROR
8642 ADD_BITFIELD_RO(ERROR_BIT_STUFF, 8, 1)
8643 // Source: SIE_STATUS.RX_OVERFLOW
8644 ADD_BITFIELD_RO(ERROR_RX_OVERFLOW, 7, 1)
8645 // Source: SIE_STATUS.RX_TIMEOUT
8646 ADD_BITFIELD_RO(ERROR_RX_TIMEOUT, 6, 1)
8647 // Source: SIE_STATUS.DATA_SEQ_ERROR
8648 ADD_BITFIELD_RO(ERROR_DATA_SEQ, 5, 1)
8649 // Raised when any bit in BUFF_STATUS is set. Clear by clearing all bits in BUFF_STATUS.
8650 ADD_BITFIELD_RO(BUFF_STATUS, 4, 1)
8651 // Raised every time SIE_STATUS.TRANS_COMPLETE is set. Clear by writing to this bit.
8652 ADD_BITFIELD_RO(TRANS_COMPLETE, 3, 1)
8653 // Host: raised every time the host sends a SOF (Start of Frame). Cleared by reading SOF_RD
8654 ADD_BITFIELD_RO(HOST_SOF, 2, 1)
8655 // Host: raised when a device wakes up the host. Cleared by writing to SIE_STATUS.RESUME
8656 ADD_BITFIELD_RO(HOST_RESUME, 1, 1)
8657 // Host: raised when a device is connected or disconnected (i.e. when SIE_STATUS.SPEED changes). Cleared by writing to SIE_STATUS.SPEED
8658 ADD_BITFIELD_RO(HOST_CONN_DIS, 0, 1)
8659 END_TYPE()
8660
8661 // Interrupt Enable
8662 // Reset value: 0x00000000
8663 BEGIN_TYPE(INTE_t, uint32_t)
8664 // Raised when any bit in EP_STATUS_STALL_NAK is set. Clear by clearing all bits in EP_STATUS_STALL_NAK.
8665 ADD_BITFIELD_RW(EP_STALL_NAK, 19, 1)
8666 // Raised when any bit in ABORT_DONE is set. Clear by clearing all bits in ABORT_DONE.
8667 ADD_BITFIELD_RW(ABORT_DONE, 18, 1)
8668 // Set every time the device receives a SOF (Start of Frame) packet. Cleared by reading SOF_RD
8669 ADD_BITFIELD_RW(DEV_SOF, 17, 1)
8670 // Device. Source: SIE_STATUS.SETUP_REC
8671 ADD_BITFIELD_RW(SETUP_REQ, 16, 1)
8672 // Set when the device receives a resume from the host. Cleared by writing to SIE_STATUS.RESUME
8673 ADD_BITFIELD_RW(DEV_RESUME_FROM_HOST, 15, 1)
8674 // Set when the device suspend state changes. Cleared by writing to SIE_STATUS.SUSPENDED
8675 ADD_BITFIELD_RW(DEV_SUSPEND, 14, 1)
8676 // Set when the device connection state changes. Cleared by writing to SIE_STATUS.CONNECTED
8677 ADD_BITFIELD_RW(DEV_CONN_DIS, 13, 1)
8678 // Source: SIE_STATUS.BUS_RESET
8679 ADD_BITFIELD_RW(BUS_RESET, 12, 1)
8680 // Source: SIE_STATUS.VBUS_DETECTED
8681 ADD_BITFIELD_RW(VBUS_DETECT, 11, 1)
8682 // Source: SIE_STATUS.STALL_REC
8683 ADD_BITFIELD_RW(STALL, 10, 1)
8684 // Source: SIE_STATUS.CRC_ERROR
8685 ADD_BITFIELD_RW(ERROR_CRC, 9, 1)
8686 // Source: SIE_STATUS.BIT_STUFF_ERROR
8687 ADD_BITFIELD_RW(ERROR_BIT_STUFF, 8, 1)
8688 // Source: SIE_STATUS.RX_OVERFLOW
8689 ADD_BITFIELD_RW(ERROR_RX_OVERFLOW, 7, 1)
8690 // Source: SIE_STATUS.RX_TIMEOUT
8691 ADD_BITFIELD_RW(ERROR_RX_TIMEOUT, 6, 1)
8692 // Source: SIE_STATUS.DATA_SEQ_ERROR
8693 ADD_BITFIELD_RW(ERROR_DATA_SEQ, 5, 1)
8694 // Raised when any bit in BUFF_STATUS is set. Clear by clearing all bits in BUFF_STATUS.
8695 ADD_BITFIELD_RW(BUFF_STATUS, 4, 1)
8696 // Raised every time SIE_STATUS.TRANS_COMPLETE is set. Clear by writing to this bit.
8697 ADD_BITFIELD_RW(TRANS_COMPLETE, 3, 1)
8698 // Host: raised every time the host sends a SOF (Start of Frame). Cleared by reading SOF_RD
8699 ADD_BITFIELD_RW(HOST_SOF, 2, 1)
8700 // Host: raised when a device wakes up the host. Cleared by writing to SIE_STATUS.RESUME
8701 ADD_BITFIELD_RW(HOST_RESUME, 1, 1)
8702 // Host: raised when a device is connected or disconnected (i.e. when SIE_STATUS.SPEED changes). Cleared by writing to SIE_STATUS.SPEED
8703 ADD_BITFIELD_RW(HOST_CONN_DIS, 0, 1)
8704 END_TYPE()
8705
8706 // Interrupt Force
8707 // Reset value: 0x00000000
8708 BEGIN_TYPE(INTF_t, uint32_t)
8709 // Raised when any bit in EP_STATUS_STALL_NAK is set. Clear by clearing all bits in EP_STATUS_STALL_NAK.
8710 ADD_BITFIELD_RW(EP_STALL_NAK, 19, 1)
8711 // Raised when any bit in ABORT_DONE is set. Clear by clearing all bits in ABORT_DONE.
8712 ADD_BITFIELD_RW(ABORT_DONE, 18, 1)
8713 // Set every time the device receives a SOF (Start of Frame) packet. Cleared by reading SOF_RD
8714 ADD_BITFIELD_RW(DEV_SOF, 17, 1)
8715 // Device. Source: SIE_STATUS.SETUP_REC
8716 ADD_BITFIELD_RW(SETUP_REQ, 16, 1)
8717 // Set when the device receives a resume from the host. Cleared by writing to SIE_STATUS.RESUME
8718 ADD_BITFIELD_RW(DEV_RESUME_FROM_HOST, 15, 1)
8719 // Set when the device suspend state changes. Cleared by writing to SIE_STATUS.SUSPENDED
8720 ADD_BITFIELD_RW(DEV_SUSPEND, 14, 1)
8721 // Set when the device connection state changes. Cleared by writing to SIE_STATUS.CONNECTED
8722 ADD_BITFIELD_RW(DEV_CONN_DIS, 13, 1)
8723 // Source: SIE_STATUS.BUS_RESET
8724 ADD_BITFIELD_RW(BUS_RESET, 12, 1)
8725 // Source: SIE_STATUS.VBUS_DETECTED
8726 ADD_BITFIELD_RW(VBUS_DETECT, 11, 1)
8727 // Source: SIE_STATUS.STALL_REC
8728 ADD_BITFIELD_RW(STALL, 10, 1)
8729 // Source: SIE_STATUS.CRC_ERROR
8730 ADD_BITFIELD_RW(ERROR_CRC, 9, 1)
8731 // Source: SIE_STATUS.BIT_STUFF_ERROR
8732 ADD_BITFIELD_RW(ERROR_BIT_STUFF, 8, 1)
8733 // Source: SIE_STATUS.RX_OVERFLOW
8734 ADD_BITFIELD_RW(ERROR_RX_OVERFLOW, 7, 1)
8735 // Source: SIE_STATUS.RX_TIMEOUT
8736 ADD_BITFIELD_RW(ERROR_RX_TIMEOUT, 6, 1)
8737 // Source: SIE_STATUS.DATA_SEQ_ERROR
8738 ADD_BITFIELD_RW(ERROR_DATA_SEQ, 5, 1)
8739 // Raised when any bit in BUFF_STATUS is set. Clear by clearing all bits in BUFF_STATUS.
8740 ADD_BITFIELD_RW(BUFF_STATUS, 4, 1)
8741 // Raised every time SIE_STATUS.TRANS_COMPLETE is set. Clear by writing to this bit.
8742 ADD_BITFIELD_RW(TRANS_COMPLETE, 3, 1)
8743 // Host: raised every time the host sends a SOF (Start of Frame). Cleared by reading SOF_RD
8744 ADD_BITFIELD_RW(HOST_SOF, 2, 1)
8745 // Host: raised when a device wakes up the host. Cleared by writing to SIE_STATUS.RESUME
8746 ADD_BITFIELD_RW(HOST_RESUME, 1, 1)
8747 // Host: raised when a device is connected or disconnected (i.e. when SIE_STATUS.SPEED changes). Cleared by writing to SIE_STATUS.SPEED
8748 ADD_BITFIELD_RW(HOST_CONN_DIS, 0, 1)
8749 END_TYPE()
8750
8751 // Interrupt status after masking & forcing
8752 // Reset value: 0x00000000
8753 BEGIN_TYPE(INTS_t, uint32_t)
8754 // Raised when any bit in EP_STATUS_STALL_NAK is set. Clear by clearing all bits in EP_STATUS_STALL_NAK.
8755 ADD_BITFIELD_RO(EP_STALL_NAK, 19, 1)
8756 // Raised when any bit in ABORT_DONE is set. Clear by clearing all bits in ABORT_DONE.
8757 ADD_BITFIELD_RO(ABORT_DONE, 18, 1)
8758 // Set every time the device receives a SOF (Start of Frame) packet. Cleared by reading SOF_RD
8759 ADD_BITFIELD_RO(DEV_SOF, 17, 1)
8760 // Device. Source: SIE_STATUS.SETUP_REC
8761 ADD_BITFIELD_RO(SETUP_REQ, 16, 1)
8762 // Set when the device receives a resume from the host. Cleared by writing to SIE_STATUS.RESUME
8763 ADD_BITFIELD_RO(DEV_RESUME_FROM_HOST, 15, 1)
8764 // Set when the device suspend state changes. Cleared by writing to SIE_STATUS.SUSPENDED
8765 ADD_BITFIELD_RO(DEV_SUSPEND, 14, 1)
8766 // Set when the device connection state changes. Cleared by writing to SIE_STATUS.CONNECTED
8767 ADD_BITFIELD_RO(DEV_CONN_DIS, 13, 1)
8768 // Source: SIE_STATUS.BUS_RESET
8769 ADD_BITFIELD_RO(BUS_RESET, 12, 1)
8770 // Source: SIE_STATUS.VBUS_DETECTED
8771 ADD_BITFIELD_RO(VBUS_DETECT, 11, 1)
8772 // Source: SIE_STATUS.STALL_REC
8773 ADD_BITFIELD_RO(STALL, 10, 1)
8774 // Source: SIE_STATUS.CRC_ERROR
8775 ADD_BITFIELD_RO(ERROR_CRC, 9, 1)
8776 // Source: SIE_STATUS.BIT_STUFF_ERROR
8777 ADD_BITFIELD_RO(ERROR_BIT_STUFF, 8, 1)
8778 // Source: SIE_STATUS.RX_OVERFLOW
8779 ADD_BITFIELD_RO(ERROR_RX_OVERFLOW, 7, 1)
8780 // Source: SIE_STATUS.RX_TIMEOUT
8781 ADD_BITFIELD_RO(ERROR_RX_TIMEOUT, 6, 1)
8782 // Source: SIE_STATUS.DATA_SEQ_ERROR
8783 ADD_BITFIELD_RO(ERROR_DATA_SEQ, 5, 1)
8784 // Raised when any bit in BUFF_STATUS is set. Clear by clearing all bits in BUFF_STATUS.
8785 ADD_BITFIELD_RO(BUFF_STATUS, 4, 1)
8786 // Raised every time SIE_STATUS.TRANS_COMPLETE is set. Clear by writing to this bit.
8787 ADD_BITFIELD_RO(TRANS_COMPLETE, 3, 1)
8788 // Host: raised every time the host sends a SOF (Start of Frame). Cleared by reading SOF_RD
8789 ADD_BITFIELD_RO(HOST_SOF, 2, 1)
8790 // Host: raised when a device wakes up the host. Cleared by writing to SIE_STATUS.RESUME
8791 ADD_BITFIELD_RO(HOST_RESUME, 1, 1)
8792 // Host: raised when a device is connected or disconnected (i.e. when SIE_STATUS.SPEED changes). Cleared by writing to SIE_STATUS.SPEED
8793 ADD_BITFIELD_RO(HOST_CONN_DIS, 0, 1)
8794 END_TYPE()
8795
8797 ADDR_ENDP_t ADDR_ENDP;
8798 ADDR_ENDP__t ADDR_ENDP_1;
8799 ADDR_ENDP__t ADDR_ENDP_2;
8800 ADDR_ENDP__t ADDR_ENDP_3;
8801 ADDR_ENDP__t ADDR_ENDP_4;
8802 ADDR_ENDP__t ADDR_ENDP_5;
8803 ADDR_ENDP__t ADDR_ENDP_6;
8804 ADDR_ENDP__t ADDR_ENDP_7;
8805 ADDR_ENDP__t ADDR_ENDP_8;
8806 ADDR_ENDP__t ADDR_ENDP_9;
8807 ADDR_ENDP__t ADDR_ENDP_10;
8808 ADDR_ENDP__t ADDR_ENDP_11;
8809 ADDR_ENDP__t ADDR_ENDP_12;
8810 ADDR_ENDP__t ADDR_ENDP_13;
8811 ADDR_ENDP__t ADDR_ENDP_14;
8812 ADDR_ENDP__t ADDR_ENDP_15;
8813 MAIN_CTRL_t MAIN_CTRL;
8814 SOF_WR_t SOF_WR;
8815 SOF_RD_t SOF_RD;
8816 SIE_CTRL_t SIE_CTRL;
8817 SIE_STATUS_t SIE_STATUS;
8818 INT_EP_CTRL_t INT_EP_CTRL;
8819 BUFF_STATUS_t BUFF_STATUS;
8820 BUFF_CPU_SHOULD_HANDLE_t BUFF_CPU_SHOULD_HANDLE;
8821 EP_ABORT_t EP_ABORT;
8822 EP_ABORT_DONE_t EP_ABORT_DONE;
8823 EP_STALL_ARM_t EP_STALL_ARM;
8824 NAK_POLL_t NAK_POLL;
8825 EP_STATUS_STALL_NAK_t EP_STATUS_STALL_NAK;
8826 USB_MUXING_t USB_MUXING;
8827 USB_PWR_t USB_PWR;
8828 USBPHY_DIRECT_t USBPHY_DIRECT;
8829 USBPHY_DIRECT_OVERRIDE_t USBPHY_DIRECT_OVERRIDE;
8830 USBPHY_TRIM_t USBPHY_TRIM;
8831 uint32_t reserved0;
8832 INTR_t INTR;
8833 INTE_t INTE;
8834 INTF_t INTF;
8835 INTS_t INTS;
8836 };
8837
8838 static USBCTRL_REGS_t & USBCTRL_REGS = (*(USBCTRL_REGS_t *)0x50110000);
8839 static USBCTRL_REGS_t & USBCTRL_REGS_XOR = (*(USBCTRL_REGS_t *)0x50111000);
8840 static USBCTRL_REGS_t & USBCTRL_REGS_SET = (*(USBCTRL_REGS_t *)0x50112000);
8841 static USBCTRL_REGS_t & USBCTRL_REGS_CLR = (*(USBCTRL_REGS_t *)0x50113000);
8842
8843} // _USBCTRL_REGS_
8844
8845// Programmable IO block
8846namespace _PIO0_ {
8847
8848 // PIO control register
8849 // Reset value: 0x00000000
8850 BEGIN_TYPE(CTRL_t, uint32_t)
8851 // Restart a state machine's clock divider from an initial phase of 0. Clock dividers are free-running, so once started, their output (including fractional jitter) is completely determined by the integer/fractional divisor configured in SMx_CLKDIV. This means that, if multiple clock dividers with the same divisor are restarted simultaneously, by writing multiple 1 bits to this field, the execution clocks of those state machines will run in precise lockstep.
8852 //
8853 // Note that setting/clearing SM_ENABLE does not stop the clock divider from running, so once multiple state machines' clocks are synchronised, it is safe to disable/reenable a state machine, whilst keeping the clock dividers in sync.
8854 //
8855 // Note also that CLKDIV_RESTART can be written to whilst the state machine is running, and this is useful to resynchronise clock dividers after the divisors (SMx_CLKDIV) have been changed on-the-fly.
8856 ADD_BITFIELD_RW(CLKDIV_RESTART, 8, 4)
8857 // Write 1 to instantly clear internal SM state which may be otherwise difficult to access and will affect future execution.
8858 //
8859 // Specifically, the following are cleared: input and output shift counters; the contents of the input shift register; the delay counter; the waiting-on-IRQ state; any stalled instruction written to SMx_INSTR or run by OUT/MOV EXEC; any pin write left asserted due to OUT_STICKY.
8860 //
8861 // The program counter, the contents of the output shift register and the X/Y scratch registers are not affected.
8862 ADD_BITFIELD_RW(SM_RESTART, 4, 4)
8863 // Enable/disable each of the four state machines by writing 1/0 to each of these four bits. When disabled, a state machine will cease executing instructions, except those written directly to SMx_INSTR by the system. Multiple bits can be set/cleared at once to run/halt multiple state machines simultaneously.
8864 ADD_BITFIELD_RW(SM_ENABLE, 0, 4)
8865 END_TYPE()
8866
8867 // FIFO status register
8868 // Reset value: 0x0f000f00
8869 BEGIN_TYPE(FSTAT_t, uint32_t)
8870 // State machine TX FIFO is empty
8871 ADD_BITFIELD_RO(TXEMPTY, 24, 4)
8872 // State machine TX FIFO is full
8873 ADD_BITFIELD_RO(TXFULL, 16, 4)
8874 // State machine RX FIFO is empty
8875 ADD_BITFIELD_RO(RXEMPTY, 8, 4)
8876 // State machine RX FIFO is full
8877 ADD_BITFIELD_RO(RXFULL, 0, 4)
8878 END_TYPE()
8879
8880 // FIFO debug register
8881 // Reset value: 0x00000000
8882 BEGIN_TYPE(FDEBUG_t, uint32_t)
8883 // State machine has stalled on empty TX FIFO during a blocking PULL, or an OUT with autopull enabled. Write 1 to clear.
8884 ADD_BITFIELD_RW(TXSTALL, 24, 4)
8885 // TX FIFO overflow (i.e. write-on-full by the system) has occurred. Write 1 to clear. Note that write-on-full does not alter the state or contents of the FIFO in any way, but the data that the system attempted to write is dropped, so if this flag is set, your software has quite likely dropped some data on the floor.
8886 ADD_BITFIELD_RW(TXOVER, 16, 4)
8887 // RX FIFO underflow (i.e. read-on-empty by the system) has occurred. Write 1 to clear. Note that read-on-empty does not perturb the state of the FIFO in any way, but the data returned by reading from an empty FIFO is undefined, so this flag generally only becomes set due to some kind of software error.
8888 ADD_BITFIELD_RW(RXUNDER, 8, 4)
8889 // State machine has stalled on full RX FIFO during a blocking PUSH, or an IN with autopush enabled. This flag is also set when a nonblocking PUSH to a full FIFO took place, in which case the state machine has dropped data. Write 1 to clear.
8890 ADD_BITFIELD_RW(RXSTALL, 0, 4)
8891 END_TYPE()
8892
8893 // FIFO levels
8894 // Reset value: 0x00000000
8895 BEGIN_TYPE(FLEVEL_t, uint32_t)
8896 ADD_BITFIELD_RO(RX3, 28, 4)
8897 ADD_BITFIELD_RO(TX3, 24, 4)
8898 ADD_BITFIELD_RO(RX2, 20, 4)
8899 ADD_BITFIELD_RO(TX2, 16, 4)
8900 ADD_BITFIELD_RO(RX1, 12, 4)
8901 ADD_BITFIELD_RO(TX1, 8, 4)
8902 ADD_BITFIELD_RO(RX0, 4, 4)
8903 ADD_BITFIELD_RO(TX0, 0, 4)
8904 END_TYPE()
8905
8906 // Direct write access to the TX FIFO for this state machine. Each write pushes one word to the FIFO. Attempting to write to a full FIFO has no effect on the FIFO state or contents, and sets the sticky FDEBUG_TXOVER error flag for this FIFO.
8907 // Reset value: 0x00000000
8908 typedef uint32_t TXF_t;
8909
8910 // Direct read access to the RX FIFO for this state machine. Each read pops one word from the FIFO. Attempting to read from an empty FIFO has no effect on the FIFO state, and sets the sticky FDEBUG_RXUNDER error flag for this FIFO. The data returned to the system on a read from an empty FIFO is undefined.
8911 // Reset value: 0x00000000
8912 typedef uint32_t RXF_t;
8913
8914 // State machine IRQ flags register. Write 1 to clear. There are 8 state machine IRQ flags, which can be set, cleared, and waited on by the state machines. There's no fixed association between flags and state machines -- any state machine can use any flag.
8915 //
8916 // Any of the 8 flags can be used for timing synchronisation between state machines, using IRQ and WAIT instructions. The lower four of these flags are also routed out to system-level interrupt requests, alongside FIFO status interrupts -- see e.g. IRQ0_INTE.
8917 // Reset value: 0x00000000
8918 BEGIN_TYPE(IRQ_t, uint32_t)
8919 ADD_BITFIELD_RW(IRQ, 0, 8)
8920 END_TYPE()
8921
8922 // Writing a 1 to each of these bits will forcibly assert the corresponding IRQ. Note this is different to the INTF register: writing here affects PIO internal state. INTF just asserts the processor-facing IRQ signal for testing ISRs, and is not visible to the state machines.
8923 // Reset value: 0x00000000
8924 BEGIN_TYPE(IRQ_FORCE_t, uint32_t)
8925 ADD_BITFIELD_WO(IRQ_FORCE, 0, 8)
8926 END_TYPE()
8927
8928 // There is a 2-flipflop synchronizer on each GPIO input, which protects PIO logic from metastabilities. This increases input delay, and for fast synchronous IO (e.g. SPI) these synchronizers may need to be bypassed. Each bit in this register corresponds to one GPIO.
8929 // 0 -> input is synchronized (default)
8930 // 1 -> synchronizer is bypassed
8931 // If in doubt, leave this register as all zeroes.
8932 // Reset value: 0x00000000
8933 typedef uint32_t INPUT_SYNC_BYPASS_t;
8934
8935 // Read to sample the pad output values PIO is currently driving to the GPIOs. On RP2040 there are 30 GPIOs, so the two most significant bits are hardwired to 0.
8936 // Reset value: 0x00000000
8937 typedef uint32_t DBG_PADOUT_t;
8938
8939 // Read to sample the pad output enables (direction) PIO is currently driving to the GPIOs. On RP2040 there are 30 GPIOs, so the two most significant bits are hardwired to 0.
8940 // Reset value: 0x00000000
8941 typedef uint32_t DBG_PADOE_t;
8942
8943 // The PIO hardware has some free parameters that may vary between chip products.
8944 // These should be provided in the chip datasheet, but are also exposed here.
8945 // Reset value: 0x00000000
8946 BEGIN_TYPE(DBG_CFGINFO_t, uint32_t)
8947 // The size of the instruction memory, measured in units of one instruction
8948 ADD_BITFIELD_RO(IMEM_SIZE, 16, 6)
8949 // The number of state machines this PIO instance is equipped with.
8950 ADD_BITFIELD_RO(SM_COUNT, 8, 4)
8951 // The depth of the state machine TX/RX FIFOs, measured in words.
8952 // Joining fifos via SHIFTCTRL_FJOIN gives one FIFO with double
8953 // this depth.
8954 ADD_BITFIELD_RO(FIFO_DEPTH, 0, 6)
8955 END_TYPE()
8956
8957 // Write-only access to instruction memory
8958 // Reset value: 0x00000000
8959 BEGIN_TYPE(INSTR_MEM_t, uint32_t)
8960 ADD_BITFIELD_WO(INSTR, 0, 16)
8961 END_TYPE()
8962
8963 // Clock divisor register for state machine 0
8964 // Frequency = clock freq / (CLKDIV_INT + CLKDIV_FRAC / 256)
8965 // Reset value: 0x00010000
8966 BEGIN_TYPE(SM_CLKDIV_t, uint32_t)
8967 // Effective frequency is sysclk/(int + frac/256).
8968 // Value of 0 is interpreted as 65536. If INT is 0, FRAC must also be 0.
8969 ADD_BITFIELD_RW(INT, 16, 16)
8970 // Fractional part of clock divisor
8971 ADD_BITFIELD_RW(FRAC, 8, 8)
8972 END_TYPE()
8973
8974 // Execution/behavioural settings for state machine 0
8975 // Reset value: 0x0001f000
8976 BEGIN_TYPE(SM_EXECCTRL_t, uint32_t)
8977 // If 1, an instruction written to SMx_INSTR is stalled, and latched by the state machine. Will clear to 0 once this instruction completes.
8978 ADD_BITFIELD_RO(EXEC_STALLED, 31, 1)
8979 // If 1, the MSB of the Delay/Side-set instruction field is used as side-set enable, rather than a side-set data bit. This allows instructions to perform side-set optionally, rather than on every instruction, but the maximum possible side-set width is reduced from 5 to 4. Note that the value of PINCTRL_SIDESET_COUNT is inclusive of this enable bit.
8980 ADD_BITFIELD_RW(SIDE_EN, 30, 1)
8981 // If 1, side-set data is asserted to pin directions, instead of pin values
8982 ADD_BITFIELD_RW(SIDE_PINDIR, 29, 1)
8983 // The GPIO number to use as condition for JMP PIN. Unaffected by input mapping.
8984 ADD_BITFIELD_RW(JMP_PIN, 24, 5)
8985 // Which data bit to use for inline OUT enable
8986 ADD_BITFIELD_RW(OUT_EN_SEL, 19, 5)
8987 // If 1, use a bit of OUT data as an auxiliary write enable
8988 // When used in conjunction with OUT_STICKY, writes with an enable of 0 will
8989 // deassert the latest pin write. This can create useful masking/override behaviour
8990 // due to the priority ordering of state machine pin writes (SM0 < SM1 < ...)
8991 ADD_BITFIELD_RW(INLINE_OUT_EN, 18, 1)
8992 // Continuously assert the most recent OUT/SET to the pins
8993 ADD_BITFIELD_RW(OUT_STICKY, 17, 1)
8994 // After reaching this address, execution is wrapped to wrap_bottom.
8995 // If the instruction is a jump, and the jump condition is true, the jump takes priority.
8996 ADD_BITFIELD_RW(WRAP_TOP, 12, 5)
8997 // After reaching wrap_top, execution is wrapped to this address.
8998 ADD_BITFIELD_RW(WRAP_BOTTOM, 7, 5)
8999 // Comparison used for the MOV x, STATUS instruction.
9000 ADD_BITFIELD_RW(STATUS_SEL, 4, 1)
9001 // Comparison level for the MOV x, STATUS instruction
9002 ADD_BITFIELD_RW(STATUS_N, 0, 4)
9003 END_TYPE()
9004
9005 // All-ones if TX FIFO level < N, otherwise all-zeroes
9006 static const uint32_t SM_EXECCTRL_STATUS_SEL__TXLEVEL = 0;
9007 // All-ones if RX FIFO level < N, otherwise all-zeroes
9008 static const uint32_t SM_EXECCTRL_STATUS_SEL__RXLEVEL = 1;
9009
9010 // Control behaviour of the input/output shift registers for state machine 0
9011 // Reset value: 0x000c0000
9012 BEGIN_TYPE(SM_SHIFTCTRL_t, uint32_t)
9013 // When 1, RX FIFO steals the TX FIFO's storage, and becomes twice as deep.
9014 // TX FIFO is disabled as a result (always reads as both full and empty).
9015 // FIFOs are flushed when this bit is changed.
9016 ADD_BITFIELD_RW(FJOIN_RX, 31, 1)
9017 // When 1, TX FIFO steals the RX FIFO's storage, and becomes twice as deep.
9018 // RX FIFO is disabled as a result (always reads as both full and empty).
9019 // FIFOs are flushed when this bit is changed.
9020 ADD_BITFIELD_RW(FJOIN_TX, 30, 1)
9021 // Number of bits shifted out of OSR before autopull, or conditional pull (PULL IFEMPTY), will take place.
9022 // Write 0 for value of 32.
9023 ADD_BITFIELD_RW(PULL_THRESH, 25, 5)
9024 // Number of bits shifted into ISR before autopush, or conditional push (PUSH IFFULL), will take place.
9025 // Write 0 for value of 32.
9026 ADD_BITFIELD_RW(PUSH_THRESH, 20, 5)
9027 // 1 = shift out of output shift register to right. 0 = to left.
9028 ADD_BITFIELD_RW(OUT_SHIFTDIR, 19, 1)
9029 // 1 = shift input shift register to right (data enters from left). 0 = to left.
9030 ADD_BITFIELD_RW(IN_SHIFTDIR, 18, 1)
9031 // Pull automatically when the output shift register is emptied, i.e. on or following an OUT instruction which causes the output shift counter to reach or exceed PULL_THRESH.
9032 ADD_BITFIELD_RW(AUTOPULL, 17, 1)
9033 // Push automatically when the input shift register is filled, i.e. on an IN instruction which causes the input shift counter to reach or exceed PUSH_THRESH.
9034 ADD_BITFIELD_RW(AUTOPUSH, 16, 1)
9035 END_TYPE()
9036
9037 // Current instruction address of state machine 0
9038 // Reset value: 0x00000000
9039 BEGIN_TYPE(SM_ADDR_t, uint32_t)
9040 ADD_BITFIELD_RO(ADDR, 0, 5)
9041 END_TYPE()
9042
9043 // Read to see the instruction currently addressed by state machine 0's program counter
9044 // Write to execute an instruction immediately (including jumps) and then resume execution.
9045 // Reset value: 0x00000000
9046 BEGIN_TYPE(SM_INSTR_t, uint32_t)
9047 ADD_BITFIELD_RW(INSTR, 0, 16)
9048 END_TYPE()
9049
9050 // State machine pin control
9051 // Reset value: 0x14000000
9052 BEGIN_TYPE(SM_PINCTRL_t, uint32_t)
9053 // The number of MSBs of the Delay/Side-set instruction field which are used for side-set. Inclusive of the enable bit, if present. Minimum of 0 (all delay bits, no side-set) and maximum of 5 (all side-set, no delay).
9054 ADD_BITFIELD_RW(SIDESET_COUNT, 29, 3)
9055 // The number of pins asserted by a SET. In the range 0 to 5 inclusive.
9056 ADD_BITFIELD_RW(SET_COUNT, 26, 3)
9057 // The number of pins asserted by an OUT PINS, OUT PINDIRS or MOV PINS instruction. In the range 0 to 32 inclusive.
9058 ADD_BITFIELD_RW(OUT_COUNT, 20, 6)
9059 // The pin which is mapped to the least-significant bit of a state machine's IN data bus. Higher-numbered pins are mapped to consecutively more-significant data bits, with a modulo of 32 applied to pin number.
9060 ADD_BITFIELD_RW(IN_BASE, 15, 5)
9061 // The lowest-numbered pin that will be affected by a side-set operation. The MSBs of an instruction's side-set/delay field (up to 5, determined by SIDESET_COUNT) are used for side-set data, with the remaining LSBs used for delay. The least-significant bit of the side-set portion is the bit written to this pin, with more-significant bits written to higher-numbered pins.
9062 ADD_BITFIELD_RW(SIDESET_BASE, 10, 5)
9063 // The lowest-numbered pin that will be affected by a SET PINS or SET PINDIRS instruction. The data written to this pin is the least-significant bit of the SET data.
9064 ADD_BITFIELD_RW(SET_BASE, 5, 5)
9065 // The lowest-numbered pin that will be affected by an OUT PINS, OUT PINDIRS or MOV PINS instruction. The data written to this pin will always be the least-significant bit of the OUT or MOV data.
9066 ADD_BITFIELD_RW(OUT_BASE, 0, 5)
9067 END_TYPE()
9068
9069 // Raw Interrupts
9070 // Reset value: 0x00000000
9071 BEGIN_TYPE(INTR_t, uint32_t)
9072 ADD_BITFIELD_RO(SM3, 11, 1)
9073 ADD_BITFIELD_RO(SM2, 10, 1)
9074 ADD_BITFIELD_RO(SM1, 9, 1)
9075 ADD_BITFIELD_RO(SM0, 8, 1)
9076 ADD_BITFIELD_RO(SM3_TXNFULL, 7, 1)
9077 ADD_BITFIELD_RO(SM2_TXNFULL, 6, 1)
9078 ADD_BITFIELD_RO(SM1_TXNFULL, 5, 1)
9079 ADD_BITFIELD_RO(SM0_TXNFULL, 4, 1)
9080 ADD_BITFIELD_RO(SM3_RXNEMPTY, 3, 1)
9081 ADD_BITFIELD_RO(SM2_RXNEMPTY, 2, 1)
9082 ADD_BITFIELD_RO(SM1_RXNEMPTY, 1, 1)
9083 ADD_BITFIELD_RO(SM0_RXNEMPTY, 0, 1)
9084 END_TYPE()
9085
9086 // Interrupt Enable for irq0
9087 // Reset value: 0x00000000
9088 BEGIN_TYPE(IRQ0_INTE_t, uint32_t)
9089 ADD_BITFIELD_RW(SM3, 11, 1)
9090 ADD_BITFIELD_RW(SM2, 10, 1)
9091 ADD_BITFIELD_RW(SM1, 9, 1)
9092 ADD_BITFIELD_RW(SM0, 8, 1)
9093 ADD_BITFIELD_RW(SM3_TXNFULL, 7, 1)
9094 ADD_BITFIELD_RW(SM2_TXNFULL, 6, 1)
9095 ADD_BITFIELD_RW(SM1_TXNFULL, 5, 1)
9096 ADD_BITFIELD_RW(SM0_TXNFULL, 4, 1)
9097 ADD_BITFIELD_RW(SM3_RXNEMPTY, 3, 1)
9098 ADD_BITFIELD_RW(SM2_RXNEMPTY, 2, 1)
9099 ADD_BITFIELD_RW(SM1_RXNEMPTY, 1, 1)
9100 ADD_BITFIELD_RW(SM0_RXNEMPTY, 0, 1)
9101 END_TYPE()
9102
9103 // Interrupt Force for irq0
9104 // Reset value: 0x00000000
9105 BEGIN_TYPE(IRQ0_INTF_t, uint32_t)
9106 ADD_BITFIELD_RW(SM3, 11, 1)
9107 ADD_BITFIELD_RW(SM2, 10, 1)
9108 ADD_BITFIELD_RW(SM1, 9, 1)
9109 ADD_BITFIELD_RW(SM0, 8, 1)
9110 ADD_BITFIELD_RW(SM3_TXNFULL, 7, 1)
9111 ADD_BITFIELD_RW(SM2_TXNFULL, 6, 1)
9112 ADD_BITFIELD_RW(SM1_TXNFULL, 5, 1)
9113 ADD_BITFIELD_RW(SM0_TXNFULL, 4, 1)
9114 ADD_BITFIELD_RW(SM3_RXNEMPTY, 3, 1)
9115 ADD_BITFIELD_RW(SM2_RXNEMPTY, 2, 1)
9116 ADD_BITFIELD_RW(SM1_RXNEMPTY, 1, 1)
9117 ADD_BITFIELD_RW(SM0_RXNEMPTY, 0, 1)
9118 END_TYPE()
9119
9120 // Interrupt status after masking & forcing for irq0
9121 // Reset value: 0x00000000
9122 BEGIN_TYPE(IRQ0_INTS_t, uint32_t)
9123 ADD_BITFIELD_RO(SM3, 11, 1)
9124 ADD_BITFIELD_RO(SM2, 10, 1)
9125 ADD_BITFIELD_RO(SM1, 9, 1)
9126 ADD_BITFIELD_RO(SM0, 8, 1)
9127 ADD_BITFIELD_RO(SM3_TXNFULL, 7, 1)
9128 ADD_BITFIELD_RO(SM2_TXNFULL, 6, 1)
9129 ADD_BITFIELD_RO(SM1_TXNFULL, 5, 1)
9130 ADD_BITFIELD_RO(SM0_TXNFULL, 4, 1)
9131 ADD_BITFIELD_RO(SM3_RXNEMPTY, 3, 1)
9132 ADD_BITFIELD_RO(SM2_RXNEMPTY, 2, 1)
9133 ADD_BITFIELD_RO(SM1_RXNEMPTY, 1, 1)
9134 ADD_BITFIELD_RO(SM0_RXNEMPTY, 0, 1)
9135 END_TYPE()
9136
9137 // Interrupt Enable for irq1
9138 // Reset value: 0x00000000
9139 BEGIN_TYPE(IRQ1_INTE_t, uint32_t)
9140 ADD_BITFIELD_RW(SM3, 11, 1)
9141 ADD_BITFIELD_RW(SM2, 10, 1)
9142 ADD_BITFIELD_RW(SM1, 9, 1)
9143 ADD_BITFIELD_RW(SM0, 8, 1)
9144 ADD_BITFIELD_RW(SM3_TXNFULL, 7, 1)
9145 ADD_BITFIELD_RW(SM2_TXNFULL, 6, 1)
9146 ADD_BITFIELD_RW(SM1_TXNFULL, 5, 1)
9147 ADD_BITFIELD_RW(SM0_TXNFULL, 4, 1)
9148 ADD_BITFIELD_RW(SM3_RXNEMPTY, 3, 1)
9149 ADD_BITFIELD_RW(SM2_RXNEMPTY, 2, 1)
9150 ADD_BITFIELD_RW(SM1_RXNEMPTY, 1, 1)
9151 ADD_BITFIELD_RW(SM0_RXNEMPTY, 0, 1)
9152 END_TYPE()
9153
9154 // Interrupt Force for irq1
9155 // Reset value: 0x00000000
9156 BEGIN_TYPE(IRQ1_INTF_t, uint32_t)
9157 ADD_BITFIELD_RW(SM3, 11, 1)
9158 ADD_BITFIELD_RW(SM2, 10, 1)
9159 ADD_BITFIELD_RW(SM1, 9, 1)
9160 ADD_BITFIELD_RW(SM0, 8, 1)
9161 ADD_BITFIELD_RW(SM3_TXNFULL, 7, 1)
9162 ADD_BITFIELD_RW(SM2_TXNFULL, 6, 1)
9163 ADD_BITFIELD_RW(SM1_TXNFULL, 5, 1)
9164 ADD_BITFIELD_RW(SM0_TXNFULL, 4, 1)
9165 ADD_BITFIELD_RW(SM3_RXNEMPTY, 3, 1)
9166 ADD_BITFIELD_RW(SM2_RXNEMPTY, 2, 1)
9167 ADD_BITFIELD_RW(SM1_RXNEMPTY, 1, 1)
9168 ADD_BITFIELD_RW(SM0_RXNEMPTY, 0, 1)
9169 END_TYPE()
9170
9171 // Interrupt status after masking & forcing for irq1
9172 // Reset value: 0x00000000
9173 BEGIN_TYPE(IRQ1_INTS_t, uint32_t)
9174 ADD_BITFIELD_RO(SM3, 11, 1)
9175 ADD_BITFIELD_RO(SM2, 10, 1)
9176 ADD_BITFIELD_RO(SM1, 9, 1)
9177 ADD_BITFIELD_RO(SM0, 8, 1)
9178 ADD_BITFIELD_RO(SM3_TXNFULL, 7, 1)
9179 ADD_BITFIELD_RO(SM2_TXNFULL, 6, 1)
9180 ADD_BITFIELD_RO(SM1_TXNFULL, 5, 1)
9181 ADD_BITFIELD_RO(SM0_TXNFULL, 4, 1)
9182 ADD_BITFIELD_RO(SM3_RXNEMPTY, 3, 1)
9183 ADD_BITFIELD_RO(SM2_RXNEMPTY, 2, 1)
9184 ADD_BITFIELD_RO(SM1_RXNEMPTY, 1, 1)
9185 ADD_BITFIELD_RO(SM0_RXNEMPTY, 0, 1)
9186 END_TYPE()
9187
9188 struct PIO0_t {
9189 CTRL_t CTRL;
9190 FSTAT_t FSTAT;
9191 FDEBUG_t FDEBUG;
9192 FLEVEL_t FLEVEL;
9193 TXF_t TXF[4];
9194 RXF_t RXF[4];
9195 IRQ_t IRQ;
9196 IRQ_FORCE_t IRQ_FORCE;
9197 INPUT_SYNC_BYPASS_t INPUT_SYNC_BYPASS;
9198 DBG_PADOUT_t DBG_PADOUT;
9199 DBG_PADOE_t DBG_PADOE;
9200 DBG_CFGINFO_t DBG_CFGINFO;
9201 INSTR_MEM_t INSTR_MEM[32];
9202 SM_CLKDIV_t SM0_CLKDIV;
9203 SM_EXECCTRL_t SM0_EXECCTRL;
9204 SM_SHIFTCTRL_t SM0_SHIFTCTRL;
9205 SM_ADDR_t SM0_ADDR;
9206 SM_INSTR_t SM0_INSTR;
9207 SM_PINCTRL_t SM0_PINCTRL;
9208 SM_CLKDIV_t SM1_CLKDIV;
9209 SM_EXECCTRL_t SM1_EXECCTRL;
9210 SM_SHIFTCTRL_t SM1_SHIFTCTRL;
9211 SM_ADDR_t SM1_ADDR;
9212 SM_INSTR_t SM1_INSTR;
9213 SM_PINCTRL_t SM1_PINCTRL;
9214 SM_CLKDIV_t SM2_CLKDIV;
9215 SM_EXECCTRL_t SM2_EXECCTRL;
9216 SM_SHIFTCTRL_t SM2_SHIFTCTRL;
9217 SM_ADDR_t SM2_ADDR;
9218 SM_INSTR_t SM2_INSTR;
9219 SM_PINCTRL_t SM2_PINCTRL;
9220 SM_CLKDIV_t SM3_CLKDIV;
9221 SM_EXECCTRL_t SM3_EXECCTRL;
9222 SM_SHIFTCTRL_t SM3_SHIFTCTRL;
9223 SM_ADDR_t SM3_ADDR;
9224 SM_INSTR_t SM3_INSTR;
9225 SM_PINCTRL_t SM3_PINCTRL;
9226 INTR_t INTR;
9227 IRQ0_INTE_t IRQ0_INTE;
9228 IRQ0_INTF_t IRQ0_INTF;
9229 IRQ0_INTS_t IRQ0_INTS;
9230 IRQ1_INTE_t IRQ1_INTE;
9231 IRQ1_INTF_t IRQ1_INTF;
9232 IRQ1_INTS_t IRQ1_INTS;
9233 };
9234
9235 static PIO0_t & PIO0 = (*(PIO0_t *)0x50200000);
9236 static PIO0_t & PIO0_XOR = (*(PIO0_t *)0x50201000);
9237 static PIO0_t & PIO0_SET = (*(PIO0_t *)0x50202000);
9238 static PIO0_t & PIO0_CLR = (*(PIO0_t *)0x50203000);
9239
9240} // _PIO0_
9241
9242namespace _PIO1_ {
9243
9244 static _PIO0_::PIO0_t & PIO1 = (*(_PIO0_::PIO0_t *)0x50300000);
9245 static _PIO0_::PIO0_t & PIO1_XOR = (*(_PIO0_::PIO0_t *)0x50301000);
9246 static _PIO0_::PIO0_t & PIO1_SET = (*(_PIO0_::PIO0_t *)0x50302000);
9247 static _PIO0_::PIO0_t & PIO1_CLR = (*(_PIO0_::PIO0_t *)0x50303000);
9248
9249} // _PIO1_
9250
9251// Single-cycle IO block
9252// Provides core-local and inter-core hardware for the two processors, with single-cycle access.
9253namespace _SIO_ {
9254
9255 // Processor core identifier
9256 // Value is 0 when read from processor core 0, and 1 when read from processor core 1.
9257 // Reset value: 0x00000000
9258 typedef uint32_t CPUID_t;
9259
9260 // Input value for GPIO pins
9261 // Reset value: 0x00000000
9262 BEGIN_TYPE(GPIO_IN_t, uint32_t)
9263 // Input value for GPIO0...29
9264 ADD_BITFIELD_RO(GPIO_IN, 0, 30)
9265 END_TYPE()
9266
9267 // Input value for QSPI pins
9268 // Reset value: 0x00000000
9269 BEGIN_TYPE(GPIO_HI_IN_t, uint32_t)
9270 // Input value on QSPI IO in order 0..5: SCLK, SSn, SD0, SD1, SD2, SD3
9271 ADD_BITFIELD_RO(GPIO_HI_IN, 0, 6)
9272 END_TYPE()
9273
9274 // GPIO output value
9275 // Reset value: 0x00000000
9276 BEGIN_TYPE(GPIO_OUT_t, uint32_t)
9277 // Set output level (1/0 -> high/low) for GPIO0...29.
9278 // Reading back gives the last value written, NOT the input value from the pins.
9279 // If core 0 and core 1 both write to GPIO_OUT simultaneously (or to a SET/CLR/XOR alias),
9280 // the result is as though the write from core 0 took place first,
9281 // and the write from core 1 was then applied to that intermediate result.
9282 ADD_BITFIELD_RW(GPIO_OUT, 0, 30)
9283 END_TYPE()
9284
9285 // GPIO output value set
9286 // Reset value: 0x00000000
9287 BEGIN_TYPE(GPIO_OUT_SET_t, uint32_t)
9288 // Perform an atomic bit-set on GPIO_OUT, i.e. `GPIO_OUT |= wdata`
9289 ADD_BITFIELD_WO(GPIO_OUT_SET, 0, 30)
9290 END_TYPE()
9291
9292 // GPIO output value clear
9293 // Reset value: 0x00000000
9294 BEGIN_TYPE(GPIO_OUT_CLR_t, uint32_t)
9295 // Perform an atomic bit-clear on GPIO_OUT, i.e. `GPIO_OUT &= ~wdata`
9296 ADD_BITFIELD_WO(GPIO_OUT_CLR, 0, 30)
9297 END_TYPE()
9298
9299 // GPIO output value XOR
9300 // Reset value: 0x00000000
9301 BEGIN_TYPE(GPIO_OUT_XOR_t, uint32_t)
9302 // Perform an atomic bitwise XOR on GPIO_OUT, i.e. `GPIO_OUT ^= wdata`
9303 ADD_BITFIELD_WO(GPIO_OUT_XOR, 0, 30)
9304 END_TYPE()
9305
9306 // GPIO output enable
9307 // Reset value: 0x00000000
9308 BEGIN_TYPE(GPIO_OE_t, uint32_t)
9309 // Set output enable (1/0 -> output/input) for GPIO0...29.
9310 // Reading back gives the last value written.
9311 // If core 0 and core 1 both write to GPIO_OE simultaneously (or to a SET/CLR/XOR alias),
9312 // the result is as though the write from core 0 took place first,
9313 // and the write from core 1 was then applied to that intermediate result.
9314 ADD_BITFIELD_RW(GPIO_OE, 0, 30)
9315 END_TYPE()
9316
9317 // GPIO output enable set
9318 // Reset value: 0x00000000
9319 BEGIN_TYPE(GPIO_OE_SET_t, uint32_t)
9320 // Perform an atomic bit-set on GPIO_OE, i.e. `GPIO_OE |= wdata`
9321 ADD_BITFIELD_WO(GPIO_OE_SET, 0, 30)
9322 END_TYPE()
9323
9324 // GPIO output enable clear
9325 // Reset value: 0x00000000
9326 BEGIN_TYPE(GPIO_OE_CLR_t, uint32_t)
9327 // Perform an atomic bit-clear on GPIO_OE, i.e. `GPIO_OE &= ~wdata`
9328 ADD_BITFIELD_WO(GPIO_OE_CLR, 0, 30)
9329 END_TYPE()
9330
9331 // GPIO output enable XOR
9332 // Reset value: 0x00000000
9333 BEGIN_TYPE(GPIO_OE_XOR_t, uint32_t)
9334 // Perform an atomic bitwise XOR on GPIO_OE, i.e. `GPIO_OE ^= wdata`
9335 ADD_BITFIELD_WO(GPIO_OE_XOR, 0, 30)
9336 END_TYPE()
9337
9338 // QSPI output value
9339 // Reset value: 0x00000000
9340 BEGIN_TYPE(GPIO_HI_OUT_t, uint32_t)
9341 // Set output level (1/0 -> high/low) for QSPI IO0...5.
9342 // Reading back gives the last value written, NOT the input value from the pins.
9343 // If core 0 and core 1 both write to GPIO_HI_OUT simultaneously (or to a SET/CLR/XOR alias),
9344 // the result is as though the write from core 0 took place first,
9345 // and the write from core 1 was then applied to that intermediate result.
9346 ADD_BITFIELD_RW(GPIO_HI_OUT, 0, 6)
9347 END_TYPE()
9348
9349 // QSPI output value set
9350 // Reset value: 0x00000000
9351 BEGIN_TYPE(GPIO_HI_OUT_SET_t, uint32_t)
9352 // Perform an atomic bit-set on GPIO_HI_OUT, i.e. `GPIO_HI_OUT |= wdata`
9353 ADD_BITFIELD_WO(GPIO_HI_OUT_SET, 0, 6)
9354 END_TYPE()
9355
9356 // QSPI output value clear
9357 // Reset value: 0x00000000
9358 BEGIN_TYPE(GPIO_HI_OUT_CLR_t, uint32_t)
9359 // Perform an atomic bit-clear on GPIO_HI_OUT, i.e. `GPIO_HI_OUT &= ~wdata`
9360 ADD_BITFIELD_WO(GPIO_HI_OUT_CLR, 0, 6)
9361 END_TYPE()
9362
9363 // QSPI output value XOR
9364 // Reset value: 0x00000000
9365 BEGIN_TYPE(GPIO_HI_OUT_XOR_t, uint32_t)
9366 // Perform an atomic bitwise XOR on GPIO_HI_OUT, i.e. `GPIO_HI_OUT ^= wdata`
9367 ADD_BITFIELD_WO(GPIO_HI_OUT_XOR, 0, 6)
9368 END_TYPE()
9369
9370 // QSPI output enable
9371 // Reset value: 0x00000000
9372 BEGIN_TYPE(GPIO_HI_OE_t, uint32_t)
9373 // Set output enable (1/0 -> output/input) for QSPI IO0...5.
9374 // Reading back gives the last value written.
9375 // If core 0 and core 1 both write to GPIO_HI_OE simultaneously (or to a SET/CLR/XOR alias),
9376 // the result is as though the write from core 0 took place first,
9377 // and the write from core 1 was then applied to that intermediate result.
9378 ADD_BITFIELD_RW(GPIO_HI_OE, 0, 6)
9379 END_TYPE()
9380
9381 // QSPI output enable set
9382 // Reset value: 0x00000000
9383 BEGIN_TYPE(GPIO_HI_OE_SET_t, uint32_t)
9384 // Perform an atomic bit-set on GPIO_HI_OE, i.e. `GPIO_HI_OE |= wdata`
9385 ADD_BITFIELD_WO(GPIO_HI_OE_SET, 0, 6)
9386 END_TYPE()
9387
9388 // QSPI output enable clear
9389 // Reset value: 0x00000000
9390 BEGIN_TYPE(GPIO_HI_OE_CLR_t, uint32_t)
9391 // Perform an atomic bit-clear on GPIO_HI_OE, i.e. `GPIO_HI_OE &= ~wdata`
9392 ADD_BITFIELD_WO(GPIO_HI_OE_CLR, 0, 6)
9393 END_TYPE()
9394
9395 // QSPI output enable XOR
9396 // Reset value: 0x00000000
9397 BEGIN_TYPE(GPIO_HI_OE_XOR_t, uint32_t)
9398 // Perform an atomic bitwise XOR on GPIO_HI_OE, i.e. `GPIO_HI_OE ^= wdata`
9399 ADD_BITFIELD_WO(GPIO_HI_OE_XOR, 0, 6)
9400 END_TYPE()
9401
9402 // Status register for inter-core FIFOs (mailboxes).
9403 // There is one FIFO in the core 0 -> core 1 direction, and one core 1 -> core 0. Both are 32 bits wide and 8 words deep.
9404 // Core 0 can see the read side of the 1->0 FIFO (RX), and the write side of 0->1 FIFO (TX).
9405 // Core 1 can see the read side of the 0->1 FIFO (RX), and the write side of 1->0 FIFO (TX).
9406 // The SIO IRQ for each core is the logical OR of the VLD, WOF and ROE fields of its FIFO_ST register.
9407 // Reset value: 0x00000002
9408 BEGIN_TYPE(FIFO_ST_t, uint32_t)
9409 // Sticky flag indicating the RX FIFO was read when empty. This read was ignored by the FIFO.
9410 ADD_BITFIELD_RW(ROE, 3, 1)
9411 // Sticky flag indicating the TX FIFO was written when full. This write was ignored by the FIFO.
9412 ADD_BITFIELD_RW(WOF, 2, 1)
9413 // Value is 1 if this core's TX FIFO is not full (i.e. if FIFO_WR is ready for more data)
9414 ADD_BITFIELD_RO(RDY, 1, 1)
9415 // Value is 1 if this core's RX FIFO is not empty (i.e. if FIFO_RD is valid)
9416 ADD_BITFIELD_RO(VLD, 0, 1)
9417 END_TYPE()
9418
9419 // Write access to this core's TX FIFO
9420 // Reset value: 0x00000000
9421 typedef uint32_t FIFO_WR_t;
9422
9423 // Read access to this core's RX FIFO
9424 // Reset value: 0x00000000
9425 typedef uint32_t FIFO_RD_t;
9426
9427 // Spinlock state
9428 // A bitmap containing the state of all 32 spinlocks (1=locked).
9429 // Mainly intended for debugging.
9430 // Reset value: 0x00000000
9431 typedef uint32_t SPINLOCK_ST_t;
9432
9433 // Divider unsigned dividend
9434 // Write to the DIVIDEND operand of the divider, i.e. the p in `p / q`.
9435 // Any operand write starts a new calculation. The results appear in QUOTIENT, REMAINDER.
9436 // UDIVIDEND/SDIVIDEND are aliases of the same internal register. The U alias starts an
9437 // unsigned calculation, and the S alias starts a signed calculation.
9438 // Reset value: 0x00000000
9439 typedef uint32_t DIV_UDIVIDEND_t;
9440
9441 // Divider unsigned divisor
9442 // Write to the DIVISOR operand of the divider, i.e. the q in `p / q`.
9443 // Any operand write starts a new calculation. The results appear in QUOTIENT, REMAINDER.
9444 // UDIVISOR/SDIVISOR are aliases of the same internal register. The U alias starts an
9445 // unsigned calculation, and the S alias starts a signed calculation.
9446 // Reset value: 0x00000000
9447 typedef uint32_t DIV_UDIVISOR_t;
9448
9449 // Divider signed dividend
9450 // The same as UDIVIDEND, but starts a signed calculation, rather than unsigned.
9451 // Reset value: 0x00000000
9452 typedef uint32_t DIV_SDIVIDEND_t;
9453
9454 // Divider signed divisor
9455 // The same as UDIVISOR, but starts a signed calculation, rather than unsigned.
9456 // Reset value: 0x00000000
9457 typedef uint32_t DIV_SDIVISOR_t;
9458
9459 // Divider result quotient
9460 // The result of `DIVIDEND / DIVISOR` (division). Contents undefined while CSR_READY is low.
9461 // For signed calculations, QUOTIENT is negative when the signs of DIVIDEND and DIVISOR differ.
9462 // This register can be written to directly, for context save/restore purposes. This halts any
9463 // in-progress calculation and sets the CSR_READY and CSR_DIRTY flags.
9464 // Reading from QUOTIENT clears the CSR_DIRTY flag, so should read results in the order
9465 // REMAINDER, QUOTIENT if CSR_DIRTY is used.
9466 // Reset value: 0x00000000
9467 typedef uint32_t DIV_QUOTIENT_t;
9468
9469 // Divider result remainder
9470 // The result of `DIVIDEND % DIVISOR` (modulo). Contents undefined while CSR_READY is low.
9471 // For signed calculations, REMAINDER is negative only when DIVIDEND is negative.
9472 // This register can be written to directly, for context save/restore purposes. This halts any
9473 // in-progress calculation and sets the CSR_READY and CSR_DIRTY flags.
9474 // Reset value: 0x00000000
9475 typedef uint32_t DIV_REMAINDER_t;
9476
9477 // Control and status register for divider.
9478 // Reset value: 0x00000001
9479 BEGIN_TYPE(DIV_CSR_t, uint32_t)
9480 // Changes to 1 when any register is written, and back to 0 when QUOTIENT is read.
9481 // Software can use this flag to make save/restore more efficient (skip if not DIRTY).
9482 // If the flag is used in this way, it's recommended to either read QUOTIENT only,
9483 // or REMAINDER and then QUOTIENT, to prevent data loss on context switch.
9484 ADD_BITFIELD_RO(DIRTY, 1, 1)
9485 // Reads as 0 when a calculation is in progress, 1 otherwise.
9486 // Writing an operand (xDIVIDEND, xDIVISOR) will immediately start a new calculation, no
9487 // matter if one is already in progress.
9488 // Writing to a result register will immediately terminate any in-progress calculation
9489 // and set the READY and DIRTY flags.
9490 ADD_BITFIELD_RO(READY, 0, 1)
9491 END_TYPE()
9492
9493 // Read/write access to accumulator 0
9494 // Reset value: 0x00000000
9495 typedef uint32_t INTERP0_ACCUM0_t;
9496
9497 // Read/write access to accumulator 1
9498 // Reset value: 0x00000000
9499 typedef uint32_t INTERP0_ACCUM1_t;
9500
9501 // Read/write access to BASE0 register.
9502 // Reset value: 0x00000000
9503 typedef uint32_t INTERP0_BASE0_t;
9504
9505 // Read/write access to BASE1 register.
9506 // Reset value: 0x00000000
9507 typedef uint32_t INTERP0_BASE1_t;
9508
9509 // Read/write access to BASE2 register.
9510 // Reset value: 0x00000000
9511 typedef uint32_t INTERP0_BASE2_t;
9512
9513 // Read LANE0 result, and simultaneously write lane results to both accumulators (POP).
9514 // Reset value: 0x00000000
9515 typedef uint32_t INTERP0_POP_LANE0_t;
9516
9517 // Read LANE1 result, and simultaneously write lane results to both accumulators (POP).
9518 // Reset value: 0x00000000
9519 typedef uint32_t INTERP0_POP_LANE1_t;
9520
9521 // Read FULL result, and simultaneously write lane results to both accumulators (POP).
9522 // Reset value: 0x00000000
9523 typedef uint32_t INTERP0_POP_FULL_t;
9524
9525 // Read LANE0 result, without altering any internal state (PEEK).
9526 // Reset value: 0x00000000
9527 typedef uint32_t INTERP0_PEEK_LANE0_t;
9528
9529 // Read LANE1 result, without altering any internal state (PEEK).
9530 // Reset value: 0x00000000
9531 typedef uint32_t INTERP0_PEEK_LANE1_t;
9532
9533 // Read FULL result, without altering any internal state (PEEK).
9534 // Reset value: 0x00000000
9535 typedef uint32_t INTERP0_PEEK_FULL_t;
9536
9537 // Control register for lane 0
9538 // Reset value: 0x00000000
9539 BEGIN_TYPE(INTERP0_CTRL_LANE0_t, uint32_t)
9540 // Set if either OVERF0 or OVERF1 is set.
9541 ADD_BITFIELD_RO(OVERF, 25, 1)
9542 // Indicates if any masked-off MSBs in ACCUM1 are set.
9543 ADD_BITFIELD_RO(OVERF1, 24, 1)
9544 // Indicates if any masked-off MSBs in ACCUM0 are set.
9545 ADD_BITFIELD_RO(OVERF0, 23, 1)
9546 // Only present on INTERP0 on each core. If BLEND mode is enabled:
9547 // - LANE1 result is a linear interpolation between BASE0 and BASE1, controlled
9548 // by the 8 LSBs of lane 1 shift and mask value (a fractional number between
9549 // 0 and 255/256ths)
9550 // - LANE0 result does not have BASE0 added (yields only the 8 LSBs of lane 1 shift+mask value)
9551 // - FULL result does not have lane 1 shift+mask value added (BASE2 + lane 0 shift+mask)
9552 // LANE1 SIGNED flag controls whether the interpolation is signed or unsigned.
9553 ADD_BITFIELD_RW(BLEND, 21, 1)
9554 // ORed into bits 29:28 of the lane result presented to the processor on the bus.
9555 // No effect on the internal 32-bit datapath. Handy for using a lane to generate sequence
9556 // of pointers into flash or SRAM.
9557 ADD_BITFIELD_RW(FORCE_MSB, 19, 2)
9558 // If 1, mask + shift is bypassed for LANE0 result. This does not affect FULL result.
9559 ADD_BITFIELD_RW(ADD_RAW, 18, 1)
9560 // If 1, feed the opposite lane's result into this lane's accumulator on POP.
9561 ADD_BITFIELD_RW(CROSS_RESULT, 17, 1)
9562 // If 1, feed the opposite lane's accumulator into this lane's shift + mask hardware.
9563 // Takes effect even if ADD_RAW is set (the CROSS_INPUT mux is before the shift+mask bypass)
9564 ADD_BITFIELD_RW(CROSS_INPUT, 16, 1)
9565 // If SIGNED is set, the shifted and masked accumulator value is sign-extended to 32 bits
9566 // before adding to BASE0, and LANE0 PEEK/POP appear extended to 32 bits when read by processor.
9567 ADD_BITFIELD_RW(SIGNED, 15, 1)
9568 // The most-significant bit allowed to pass by the mask (inclusive)
9569 // Setting MSB < LSB may cause chip to turn inside-out
9570 ADD_BITFIELD_RW(MASK_MSB, 10, 5)
9571 // The least-significant bit allowed to pass by the mask (inclusive)
9572 ADD_BITFIELD_RW(MASK_LSB, 5, 5)
9573 // Logical right-shift applied to accumulator before masking
9574 ADD_BITFIELD_RW(SHIFT, 0, 5)
9575 END_TYPE()
9576
9577 // Control register for lane 1
9578 // Reset value: 0x00000000
9579 BEGIN_TYPE(INTERP0_CTRL_LANE1_t, uint32_t)
9580 // ORed into bits 29:28 of the lane result presented to the processor on the bus.
9581 // No effect on the internal 32-bit datapath. Handy for using a lane to generate sequence
9582 // of pointers into flash or SRAM.
9583 ADD_BITFIELD_RW(FORCE_MSB, 19, 2)
9584 // If 1, mask + shift is bypassed for LANE1 result. This does not affect FULL result.
9585 ADD_BITFIELD_RW(ADD_RAW, 18, 1)
9586 // If 1, feed the opposite lane's result into this lane's accumulator on POP.
9587 ADD_BITFIELD_RW(CROSS_RESULT, 17, 1)
9588 // If 1, feed the opposite lane's accumulator into this lane's shift + mask hardware.
9589 // Takes effect even if ADD_RAW is set (the CROSS_INPUT mux is before the shift+mask bypass)
9590 ADD_BITFIELD_RW(CROSS_INPUT, 16, 1)
9591 // If SIGNED is set, the shifted and masked accumulator value is sign-extended to 32 bits
9592 // before adding to BASE1, and LANE1 PEEK/POP appear extended to 32 bits when read by processor.
9593 ADD_BITFIELD_RW(SIGNED, 15, 1)
9594 // The most-significant bit allowed to pass by the mask (inclusive)
9595 // Setting MSB < LSB may cause chip to turn inside-out
9596 ADD_BITFIELD_RW(MASK_MSB, 10, 5)
9597 // The least-significant bit allowed to pass by the mask (inclusive)
9598 ADD_BITFIELD_RW(MASK_LSB, 5, 5)
9599 // Logical right-shift applied to accumulator before masking
9600 ADD_BITFIELD_RW(SHIFT, 0, 5)
9601 END_TYPE()
9602
9603 // Values written here are atomically added to ACCUM0
9604 // Reading yields lane 0's raw shift and mask value (BASE0 not added).
9605 // Reset value: 0x00000000
9606 BEGIN_TYPE(INTERP0_ACCUM0_ADD_t, uint32_t)
9607 ADD_BITFIELD_RW(INTERP0_ACCUM0_ADD, 0, 24)
9608 END_TYPE()
9609
9610 // Values written here are atomically added to ACCUM1
9611 // Reading yields lane 1's raw shift and mask value (BASE1 not added).
9612 // Reset value: 0x00000000
9613 BEGIN_TYPE(INTERP0_ACCUM1_ADD_t, uint32_t)
9614 ADD_BITFIELD_RW(INTERP0_ACCUM1_ADD, 0, 24)
9615 END_TYPE()
9616
9617 // On write, the lower 16 bits go to BASE0, upper bits to BASE1 simultaneously.
9618 // Each half is sign-extended to 32 bits if that lane's SIGNED flag is set.
9619 // Reset value: 0x00000000
9620 typedef uint32_t INTERP0_BASE_1AND0_t;
9621
9622 // Read/write access to accumulator 0
9623 // Reset value: 0x00000000
9624 typedef uint32_t INTERP1_ACCUM0_t;
9625
9626 // Read/write access to accumulator 1
9627 // Reset value: 0x00000000
9628 typedef uint32_t INTERP1_ACCUM1_t;
9629
9630 // Read/write access to BASE0 register.
9631 // Reset value: 0x00000000
9632 typedef uint32_t INTERP1_BASE0_t;
9633
9634 // Read/write access to BASE1 register.
9635 // Reset value: 0x00000000
9636 typedef uint32_t INTERP1_BASE1_t;
9637
9638 // Read/write access to BASE2 register.
9639 // Reset value: 0x00000000
9640 typedef uint32_t INTERP1_BASE2_t;
9641
9642 // Read LANE0 result, and simultaneously write lane results to both accumulators (POP).
9643 // Reset value: 0x00000000
9644 typedef uint32_t INTERP1_POP_LANE0_t;
9645
9646 // Read LANE1 result, and simultaneously write lane results to both accumulators (POP).
9647 // Reset value: 0x00000000
9648 typedef uint32_t INTERP1_POP_LANE1_t;
9649
9650 // Read FULL result, and simultaneously write lane results to both accumulators (POP).
9651 // Reset value: 0x00000000
9652 typedef uint32_t INTERP1_POP_FULL_t;
9653
9654 // Read LANE0 result, without altering any internal state (PEEK).
9655 // Reset value: 0x00000000
9656 typedef uint32_t INTERP1_PEEK_LANE0_t;
9657
9658 // Read LANE1 result, without altering any internal state (PEEK).
9659 // Reset value: 0x00000000
9660 typedef uint32_t INTERP1_PEEK_LANE1_t;
9661
9662 // Read FULL result, without altering any internal state (PEEK).
9663 // Reset value: 0x00000000
9664 typedef uint32_t INTERP1_PEEK_FULL_t;
9665
9666 // Control register for lane 0
9667 // Reset value: 0x00000000
9668 BEGIN_TYPE(INTERP1_CTRL_LANE0_t, uint32_t)
9669 // Set if either OVERF0 or OVERF1 is set.
9670 ADD_BITFIELD_RO(OVERF, 25, 1)
9671 // Indicates if any masked-off MSBs in ACCUM1 are set.
9672 ADD_BITFIELD_RO(OVERF1, 24, 1)
9673 // Indicates if any masked-off MSBs in ACCUM0 are set.
9674 ADD_BITFIELD_RO(OVERF0, 23, 1)
9675 // Only present on INTERP1 on each core. If CLAMP mode is enabled:
9676 // - LANE0 result is shifted and masked ACCUM0, clamped by a lower bound of
9677 // BASE0 and an upper bound of BASE1.
9678 // - Signedness of these comparisons is determined by LANE0_CTRL_SIGNED
9679 ADD_BITFIELD_RW(CLAMP, 22, 1)
9680 // ORed into bits 29:28 of the lane result presented to the processor on the bus.
9681 // No effect on the internal 32-bit datapath. Handy for using a lane to generate sequence
9682 // of pointers into flash or SRAM.
9683 ADD_BITFIELD_RW(FORCE_MSB, 19, 2)
9684 // If 1, mask + shift is bypassed for LANE0 result. This does not affect FULL result.
9685 ADD_BITFIELD_RW(ADD_RAW, 18, 1)
9686 // If 1, feed the opposite lane's result into this lane's accumulator on POP.
9687 ADD_BITFIELD_RW(CROSS_RESULT, 17, 1)
9688 // If 1, feed the opposite lane's accumulator into this lane's shift + mask hardware.
9689 // Takes effect even if ADD_RAW is set (the CROSS_INPUT mux is before the shift+mask bypass)
9690 ADD_BITFIELD_RW(CROSS_INPUT, 16, 1)
9691 // If SIGNED is set, the shifted and masked accumulator value is sign-extended to 32 bits
9692 // before adding to BASE0, and LANE0 PEEK/POP appear extended to 32 bits when read by processor.
9693 ADD_BITFIELD_RW(SIGNED, 15, 1)
9694 // The most-significant bit allowed to pass by the mask (inclusive)
9695 // Setting MSB < LSB may cause chip to turn inside-out
9696 ADD_BITFIELD_RW(MASK_MSB, 10, 5)
9697 // The least-significant bit allowed to pass by the mask (inclusive)
9698 ADD_BITFIELD_RW(MASK_LSB, 5, 5)
9699 // Logical right-shift applied to accumulator before masking
9700 ADD_BITFIELD_RW(SHIFT, 0, 5)
9701 END_TYPE()
9702
9703 // Control register for lane 1
9704 // Reset value: 0x00000000
9705 BEGIN_TYPE(INTERP1_CTRL_LANE1_t, uint32_t)
9706 // ORed into bits 29:28 of the lane result presented to the processor on the bus.
9707 // No effect on the internal 32-bit datapath. Handy for using a lane to generate sequence
9708 // of pointers into flash or SRAM.
9709 ADD_BITFIELD_RW(FORCE_MSB, 19, 2)
9710 // If 1, mask + shift is bypassed for LANE1 result. This does not affect FULL result.
9711 ADD_BITFIELD_RW(ADD_RAW, 18, 1)
9712 // If 1, feed the opposite lane's result into this lane's accumulator on POP.
9713 ADD_BITFIELD_RW(CROSS_RESULT, 17, 1)
9714 // If 1, feed the opposite lane's accumulator into this lane's shift + mask hardware.
9715 // Takes effect even if ADD_RAW is set (the CROSS_INPUT mux is before the shift+mask bypass)
9716 ADD_BITFIELD_RW(CROSS_INPUT, 16, 1)
9717 // If SIGNED is set, the shifted and masked accumulator value is sign-extended to 32 bits
9718 // before adding to BASE1, and LANE1 PEEK/POP appear extended to 32 bits when read by processor.
9719 ADD_BITFIELD_RW(SIGNED, 15, 1)
9720 // The most-significant bit allowed to pass by the mask (inclusive)
9721 // Setting MSB < LSB may cause chip to turn inside-out
9722 ADD_BITFIELD_RW(MASK_MSB, 10, 5)
9723 // The least-significant bit allowed to pass by the mask (inclusive)
9724 ADD_BITFIELD_RW(MASK_LSB, 5, 5)
9725 // Logical right-shift applied to accumulator before masking
9726 ADD_BITFIELD_RW(SHIFT, 0, 5)
9727 END_TYPE()
9728
9729 // Values written here are atomically added to ACCUM0
9730 // Reading yields lane 0's raw shift and mask value (BASE0 not added).
9731 // Reset value: 0x00000000
9732 BEGIN_TYPE(INTERP1_ACCUM0_ADD_t, uint32_t)
9733 ADD_BITFIELD_RW(INTERP1_ACCUM0_ADD, 0, 24)
9734 END_TYPE()
9735
9736 // Values written here are atomically added to ACCUM1
9737 // Reading yields lane 1's raw shift and mask value (BASE1 not added).
9738 // Reset value: 0x00000000
9739 BEGIN_TYPE(INTERP1_ACCUM1_ADD_t, uint32_t)
9740 ADD_BITFIELD_RW(INTERP1_ACCUM1_ADD, 0, 24)
9741 END_TYPE()
9742
9743 // On write, the lower 16 bits go to BASE0, upper bits to BASE1 simultaneously.
9744 // Each half is sign-extended to 32 bits if that lane's SIGNED flag is set.
9745 // Reset value: 0x00000000
9746 typedef uint32_t INTERP1_BASE_1AND0_t;
9747
9748 // Reading from a spinlock address will:
9749 // - Return 0 if lock is already locked
9750 // - Otherwise return nonzero, and simultaneously claim the lock
9751 //
9752 // Writing (any value) releases the lock.
9753 // If core 0 and core 1 attempt to claim the same lock simultaneously, core 0 wins.
9754 // The value returned on success is 0x1 << lock number.
9755 // Reset value: 0x00000000
9756 typedef uint32_t SPINLOCK_t;
9757
9758 struct SIO_t {
9759 CPUID_t CPUID;
9760 GPIO_IN_t GPIO_IN;
9761 GPIO_HI_IN_t GPIO_HI_IN;
9762 uint32_t reserved0;
9763 GPIO_OUT_t GPIO_OUT;
9764 GPIO_OUT_SET_t GPIO_OUT_SET;
9765 GPIO_OUT_CLR_t GPIO_OUT_CLR;
9766 GPIO_OUT_XOR_t GPIO_OUT_XOR;
9767 GPIO_OE_t GPIO_OE;
9768 GPIO_OE_SET_t GPIO_OE_SET;
9769 GPIO_OE_CLR_t GPIO_OE_CLR;
9770 GPIO_OE_XOR_t GPIO_OE_XOR;
9771 GPIO_HI_OUT_t GPIO_HI_OUT;
9772 GPIO_HI_OUT_SET_t GPIO_HI_OUT_SET;
9773 GPIO_HI_OUT_CLR_t GPIO_HI_OUT_CLR;
9774 GPIO_HI_OUT_XOR_t GPIO_HI_OUT_XOR;
9775 GPIO_HI_OE_t GPIO_HI_OE;
9776 GPIO_HI_OE_SET_t GPIO_HI_OE_SET;
9777 GPIO_HI_OE_CLR_t GPIO_HI_OE_CLR;
9778 GPIO_HI_OE_XOR_t GPIO_HI_OE_XOR;
9779 FIFO_ST_t FIFO_ST;
9780 FIFO_WR_t FIFO_WR;
9781 FIFO_RD_t FIFO_RD;
9782 SPINLOCK_ST_t SPINLOCK_ST;
9783 DIV_UDIVIDEND_t DIV_UDIVIDEND;
9784 DIV_UDIVISOR_t DIV_UDIVISOR;
9785 DIV_SDIVIDEND_t DIV_SDIVIDEND;
9786 DIV_SDIVISOR_t DIV_SDIVISOR;
9787 DIV_QUOTIENT_t DIV_QUOTIENT;
9788 DIV_REMAINDER_t DIV_REMAINDER;
9789 DIV_CSR_t DIV_CSR;
9790 uint32_t reserved1;
9791 INTERP0_ACCUM0_t INTERP0_ACCUM0;
9792 INTERP0_ACCUM1_t INTERP0_ACCUM1;
9793 INTERP0_BASE0_t INTERP0_BASE0;
9794 INTERP0_BASE1_t INTERP0_BASE1;
9795 INTERP0_BASE2_t INTERP0_BASE2;
9796 INTERP0_POP_LANE0_t INTERP0_POP_LANE0;
9797 INTERP0_POP_LANE1_t INTERP0_POP_LANE1;
9798 INTERP0_POP_FULL_t INTERP0_POP_FULL;
9799 INTERP0_PEEK_LANE0_t INTERP0_PEEK_LANE0;
9800 INTERP0_PEEK_LANE1_t INTERP0_PEEK_LANE1;
9801 INTERP0_PEEK_FULL_t INTERP0_PEEK_FULL;
9802 INTERP0_CTRL_LANE0_t INTERP0_CTRL_LANE0;
9803 INTERP0_CTRL_LANE1_t INTERP0_CTRL_LANE1;
9804 INTERP0_ACCUM0_ADD_t INTERP0_ACCUM0_ADD;
9805 INTERP0_ACCUM1_ADD_t INTERP0_ACCUM1_ADD;
9806 INTERP0_BASE_1AND0_t INTERP0_BASE_1AND0;
9807 INTERP1_ACCUM0_t INTERP1_ACCUM0;
9808 INTERP1_ACCUM1_t INTERP1_ACCUM1;
9809 INTERP1_BASE0_t INTERP1_BASE0;
9810 INTERP1_BASE1_t INTERP1_BASE1;
9811 INTERP1_BASE2_t INTERP1_BASE2;
9812 INTERP1_POP_LANE0_t INTERP1_POP_LANE0;
9813 INTERP1_POP_LANE1_t INTERP1_POP_LANE1;
9814 INTERP1_POP_FULL_t INTERP1_POP_FULL;
9815 INTERP1_PEEK_LANE0_t INTERP1_PEEK_LANE0;
9816 INTERP1_PEEK_LANE1_t INTERP1_PEEK_LANE1;
9817 INTERP1_PEEK_FULL_t INTERP1_PEEK_FULL;
9818 INTERP1_CTRL_LANE0_t INTERP1_CTRL_LANE0;
9819 INTERP1_CTRL_LANE1_t INTERP1_CTRL_LANE1;
9820 INTERP1_ACCUM0_ADD_t INTERP1_ACCUM0_ADD;
9821 INTERP1_ACCUM1_ADD_t INTERP1_ACCUM1_ADD;
9822 INTERP1_BASE_1AND0_t INTERP1_BASE_1AND0;
9823 SPINLOCK_t SPINLOCK[32];
9824 };
9825
9826 static SIO_t & SIO = (*(SIO_t *)0xd0000000);
9827
9828} // _SIO_
9829
9830namespace _PPB_ {
9831
9832 // Use the SysTick Control and Status Register to enable the SysTick features.
9833 // Reset value: 0x00000000
9834 BEGIN_TYPE(SYST_CSR_t, uint32_t)
9835 // Returns 1 if timer counted to 0 since last time this was read. Clears on read by application or debugger.
9836 ADD_BITFIELD_RO(COUNTFLAG, 16, 1)
9837 // SysTick clock source. Always reads as one if SYST_CALIB reports NOREF.
9838 // Selects the SysTick timer clock source:
9839 // 0 = External reference clock.
9840 // 1 = Processor clock.
9841 ADD_BITFIELD_RW(CLKSOURCE, 2, 1)
9842 // Enables SysTick exception request:
9843 // 0 = Counting down to zero does not assert the SysTick exception request.
9844 // 1 = Counting down to zero to asserts the SysTick exception request.
9845 ADD_BITFIELD_RW(TICKINT, 1, 1)
9846 // Enable SysTick counter:
9847 // 0 = Counter disabled.
9848 // 1 = Counter enabled.
9849 ADD_BITFIELD_RW(ENABLE, 0, 1)
9850 END_TYPE()
9851
9852 // Use the SysTick Reload Value Register to specify the start value to load into the current value register when the counter reaches 0. It can be any value between 0 and 0x00FFFFFF. A start value of 0 is possible, but has no effect because the SysTick interrupt and COUNTFLAG are activated when counting from 1 to 0. The reset value of this register is UNKNOWN.
9853 // To generate a multi-shot timer with a period of N processor clock cycles, use a RELOAD value of N-1. For example, if the SysTick interrupt is required every 100 clock pulses, set RELOAD to 99.
9854 // Reset value: 0x00000000
9855 BEGIN_TYPE(SYST_RVR_t, uint32_t)
9856 // Value to load into the SysTick Current Value Register when the counter reaches 0.
9857 ADD_BITFIELD_RW(RELOAD, 0, 24)
9858 END_TYPE()
9859
9860 // Use the SysTick Current Value Register to find the current value in the register. The reset value of this register is UNKNOWN.
9861 // Reset value: 0x00000000
9862 BEGIN_TYPE(SYST_CVR_t, uint32_t)
9863 // Reads return the current value of the SysTick counter. This register is write-clear. Writing to it with any value clears the register to 0. Clearing this register also clears the COUNTFLAG bit of the SysTick Control and Status Register.
9864 ADD_BITFIELD_RW(CURRENT, 0, 24)
9865 END_TYPE()
9866
9867 // Use the SysTick Calibration Value Register to enable software to scale to any required speed using divide and multiply.
9868 // Reset value: 0x00000000
9869 BEGIN_TYPE(SYST_CALIB_t, uint32_t)
9870 // If reads as 1, the Reference clock is not provided - the CLKSOURCE bit of the SysTick Control and Status register will be forced to 1 and cannot be cleared to 0.
9871 ADD_BITFIELD_RO(NOREF, 31, 1)
9872 // If reads as 1, the calibration value for 10ms is inexact (due to clock frequency).
9873 ADD_BITFIELD_RO(SKEW, 30, 1)
9874 // An optional Reload value to be used for 10ms (100Hz) timing, subject to system clock skew errors. If the value reads as 0, the calibration value is not known.
9875 ADD_BITFIELD_RO(TENMS, 0, 24)
9876 END_TYPE()
9877
9878 // Use the Interrupt Set-Enable Register to enable interrupts and determine which interrupts are currently enabled.
9879 // If a pending interrupt is enabled, the NVIC activates the interrupt based on its priority. If an interrupt is not enabled, asserting its interrupt signal changes the interrupt state to pending, but the NVIC never activates the interrupt, regardless of its priority.
9880 // Reset value: 0x00000000
9881 BEGIN_TYPE(NVIC_ISER_t, uint32_t)
9882 // Interrupt set-enable bits.
9883 // Write:
9884 // 0 = No effect.
9885 // 1 = Enable interrupt.
9886 // Read:
9887 // 0 = Interrupt disabled.
9888 // 1 = Interrupt enabled.
9889 ADD_BITFIELD_RW(SETENA, 0, 32)
9890 END_TYPE()
9891
9892 // Use the Interrupt Clear-Enable Registers to disable interrupts and determine which interrupts are currently enabled.
9893 // Reset value: 0x00000000
9894 BEGIN_TYPE(NVIC_ICER_t, uint32_t)
9895 // Interrupt clear-enable bits.
9896 // Write:
9897 // 0 = No effect.
9898 // 1 = Disable interrupt.
9899 // Read:
9900 // 0 = Interrupt disabled.
9901 // 1 = Interrupt enabled.
9902 ADD_BITFIELD_RW(CLRENA, 0, 32)
9903 END_TYPE()
9904
9905 // The NVIC_ISPR forces interrupts into the pending state, and shows which interrupts are pending.
9906 // Reset value: 0x00000000
9907 BEGIN_TYPE(NVIC_ISPR_t, uint32_t)
9908 // Interrupt set-pending bits.
9909 // Write:
9910 // 0 = No effect.
9911 // 1 = Changes interrupt state to pending.
9912 // Read:
9913 // 0 = Interrupt is not pending.
9914 // 1 = Interrupt is pending.
9915 // Note: Writing 1 to the NVIC_ISPR bit corresponding to:
9916 // An interrupt that is pending has no effect.
9917 // A disabled interrupt sets the state of that interrupt to pending.
9918 ADD_BITFIELD_RW(SETPEND, 0, 32)
9919 END_TYPE()
9920
9921 // Use the Interrupt Clear-Pending Register to clear pending interrupts and determine which interrupts are currently pending.
9922 // Reset value: 0x00000000
9923 BEGIN_TYPE(NVIC_ICPR_t, uint32_t)
9924 // Interrupt clear-pending bits.
9925 // Write:
9926 // 0 = No effect.
9927 // 1 = Removes pending state and interrupt.
9928 // Read:
9929 // 0 = Interrupt is not pending.
9930 // 1 = Interrupt is pending.
9931 ADD_BITFIELD_RW(CLRPEND, 0, 32)
9932 END_TYPE()
9933
9934 // Use the Interrupt Priority Registers to assign a priority from 0 to 3 to each of the available interrupts. 0 is the highest priority, and 3 is the lowest.
9935 // Note: Writing 1 to an NVIC_ICPR bit does not affect the active state of the corresponding interrupt.
9936 // These registers are only word-accessible
9937 // Reset value: 0x00000000
9938 BEGIN_TYPE(NVIC_IPR0_t, uint32_t)
9939 // Priority of interrupt 3
9940 ADD_BITFIELD_RW(IP_3, 30, 2)
9941 // Priority of interrupt 2
9942 ADD_BITFIELD_RW(IP_2, 22, 2)
9943 // Priority of interrupt 1
9944 ADD_BITFIELD_RW(IP_1, 14, 2)
9945 // Priority of interrupt 0
9946 ADD_BITFIELD_RW(IP_0, 6, 2)
9947 END_TYPE()
9948
9949 // Use the Interrupt Priority Registers to assign a priority from 0 to 3 to each of the available interrupts. 0 is the highest priority, and 3 is the lowest.
9950 // Reset value: 0x00000000
9951 BEGIN_TYPE(NVIC_IPR1_t, uint32_t)
9952 // Priority of interrupt 7
9953 ADD_BITFIELD_RW(IP_7, 30, 2)
9954 // Priority of interrupt 6
9955 ADD_BITFIELD_RW(IP_6, 22, 2)
9956 // Priority of interrupt 5
9957 ADD_BITFIELD_RW(IP_5, 14, 2)
9958 // Priority of interrupt 4
9959 ADD_BITFIELD_RW(IP_4, 6, 2)
9960 END_TYPE()
9961
9962 // Use the Interrupt Priority Registers to assign a priority from 0 to 3 to each of the available interrupts. 0 is the highest priority, and 3 is the lowest.
9963 // Reset value: 0x00000000
9964 BEGIN_TYPE(NVIC_IPR2_t, uint32_t)
9965 // Priority of interrupt 11
9966 ADD_BITFIELD_RW(IP_11, 30, 2)
9967 // Priority of interrupt 10
9968 ADD_BITFIELD_RW(IP_10, 22, 2)
9969 // Priority of interrupt 9
9970 ADD_BITFIELD_RW(IP_9, 14, 2)
9971 // Priority of interrupt 8
9972 ADD_BITFIELD_RW(IP_8, 6, 2)
9973 END_TYPE()
9974
9975 // Use the Interrupt Priority Registers to assign a priority from 0 to 3 to each of the available interrupts. 0 is the highest priority, and 3 is the lowest.
9976 // Reset value: 0x00000000
9977 BEGIN_TYPE(NVIC_IPR3_t, uint32_t)
9978 // Priority of interrupt 15
9979 ADD_BITFIELD_RW(IP_15, 30, 2)
9980 // Priority of interrupt 14
9981 ADD_BITFIELD_RW(IP_14, 22, 2)
9982 // Priority of interrupt 13
9983 ADD_BITFIELD_RW(IP_13, 14, 2)
9984 // Priority of interrupt 12
9985 ADD_BITFIELD_RW(IP_12, 6, 2)
9986 END_TYPE()
9987
9988 // Use the Interrupt Priority Registers to assign a priority from 0 to 3 to each of the available interrupts. 0 is the highest priority, and 3 is the lowest.
9989 // Reset value: 0x00000000
9990 BEGIN_TYPE(NVIC_IPR4_t, uint32_t)
9991 // Priority of interrupt 19
9992 ADD_BITFIELD_RW(IP_19, 30, 2)
9993 // Priority of interrupt 18
9994 ADD_BITFIELD_RW(IP_18, 22, 2)
9995 // Priority of interrupt 17
9996 ADD_BITFIELD_RW(IP_17, 14, 2)
9997 // Priority of interrupt 16
9998 ADD_BITFIELD_RW(IP_16, 6, 2)
9999 END_TYPE()
10000
10001 // Use the Interrupt Priority Registers to assign a priority from 0 to 3 to each of the available interrupts. 0 is the highest priority, and 3 is the lowest.
10002 // Reset value: 0x00000000
10003 BEGIN_TYPE(NVIC_IPR5_t, uint32_t)
10004 // Priority of interrupt 23
10005 ADD_BITFIELD_RW(IP_23, 30, 2)
10006 // Priority of interrupt 22
10007 ADD_BITFIELD_RW(IP_22, 22, 2)
10008 // Priority of interrupt 21
10009 ADD_BITFIELD_RW(IP_21, 14, 2)
10010 // Priority of interrupt 20
10011 ADD_BITFIELD_RW(IP_20, 6, 2)
10012 END_TYPE()
10013
10014 // Use the Interrupt Priority Registers to assign a priority from 0 to 3 to each of the available interrupts. 0 is the highest priority, and 3 is the lowest.
10015 // Reset value: 0x00000000
10016 BEGIN_TYPE(NVIC_IPR6_t, uint32_t)
10017 // Priority of interrupt 27
10018 ADD_BITFIELD_RW(IP_27, 30, 2)
10019 // Priority of interrupt 26
10020 ADD_BITFIELD_RW(IP_26, 22, 2)
10021 // Priority of interrupt 25
10022 ADD_BITFIELD_RW(IP_25, 14, 2)
10023 // Priority of interrupt 24
10024 ADD_BITFIELD_RW(IP_24, 6, 2)
10025 END_TYPE()
10026
10027 // Use the Interrupt Priority Registers to assign a priority from 0 to 3 to each of the available interrupts. 0 is the highest priority, and 3 is the lowest.
10028 // Reset value: 0x00000000
10029 BEGIN_TYPE(NVIC_IPR7_t, uint32_t)
10030 // Priority of interrupt 31
10031 ADD_BITFIELD_RW(IP_31, 30, 2)
10032 // Priority of interrupt 30
10033 ADD_BITFIELD_RW(IP_30, 22, 2)
10034 // Priority of interrupt 29
10035 ADD_BITFIELD_RW(IP_29, 14, 2)
10036 // Priority of interrupt 28
10037 ADD_BITFIELD_RW(IP_28, 6, 2)
10038 END_TYPE()
10039
10040 // Read the CPU ID Base Register to determine: the ID number of the processor core, the version number of the processor core, the implementation details of the processor core.
10041 // Reset value: 0x410cc601
10042 BEGIN_TYPE(CPUID_t, uint32_t)
10043 // Implementor code: 0x41 = ARM
10044 ADD_BITFIELD_RO(IMPLEMENTER, 24, 8)
10045 // Major revision number n in the rnpm revision status:
10046 // 0x0 = Revision 0.
10047 ADD_BITFIELD_RO(VARIANT, 20, 4)
10048 // Constant that defines the architecture of the processor:
10049 // 0xC = ARMv6-M architecture.
10050 ADD_BITFIELD_RO(ARCHITECTURE, 16, 4)
10051 // Number of processor within family: 0xC60 = Cortex-M0+
10052 ADD_BITFIELD_RO(PARTNO, 4, 12)
10053 // Minor revision number m in the rnpm revision status:
10054 // 0x1 = Patch 1.
10055 ADD_BITFIELD_RO(REVISION, 0, 4)
10056 END_TYPE()
10057
10058 // Use the Interrupt Control State Register to set a pending Non-Maskable Interrupt (NMI), set or clear a pending PendSV, set or clear a pending SysTick, check for pending exceptions, check the vector number of the highest priority pended exception, check the vector number of the active exception.
10059 // Reset value: 0x00000000
10060 BEGIN_TYPE(ICSR_t, uint32_t)
10061 // Setting this bit will activate an NMI. Since NMI is the highest priority exception, it will activate as soon as it is registered.
10062 // NMI set-pending bit.
10063 // Write:
10064 // 0 = No effect.
10065 // 1 = Changes NMI exception state to pending.
10066 // Read:
10067 // 0 = NMI exception is not pending.
10068 // 1 = NMI exception is pending.
10069 // Because NMI is the highest-priority exception, normally the processor enters the NMI
10070 // exception handler as soon as it detects a write of 1 to this bit. Entering the handler then clears
10071 // this bit to 0. This means a read of this bit by the NMI exception handler returns 1 only if the
10072 // NMI signal is reasserted while the processor is executing that handler.
10073 ADD_BITFIELD_RW(NMIPENDSET, 31, 1)
10074 // PendSV set-pending bit.
10075 // Write:
10076 // 0 = No effect.
10077 // 1 = Changes PendSV exception state to pending.
10078 // Read:
10079 // 0 = PendSV exception is not pending.
10080 // 1 = PendSV exception is pending.
10081 // Writing 1 to this bit is the only way to set the PendSV exception state to pending.
10082 ADD_BITFIELD_RW(PENDSVSET, 28, 1)
10083 // PendSV clear-pending bit.
10084 // Write:
10085 // 0 = No effect.
10086 // 1 = Removes the pending state from the PendSV exception.
10087 ADD_BITFIELD_RW(PENDSVCLR, 27, 1)
10088 // SysTick exception set-pending bit.
10089 // Write:
10090 // 0 = No effect.
10091 // 1 = Changes SysTick exception state to pending.
10092 // Read:
10093 // 0 = SysTick exception is not pending.
10094 // 1 = SysTick exception is pending.
10095 ADD_BITFIELD_RW(PENDSTSET, 26, 1)
10096 // SysTick exception clear-pending bit.
10097 // Write:
10098 // 0 = No effect.
10099 // 1 = Removes the pending state from the SysTick exception.
10100 // This bit is WO. On a register read its value is Unknown.
10101 ADD_BITFIELD_RW(PENDSTCLR, 25, 1)
10102 // The system can only access this bit when the core is halted. It indicates that a pending interrupt is to be taken in the next running cycle. If C_MASKINTS is clear in the Debug Halting Control and Status Register, the interrupt is serviced.
10103 ADD_BITFIELD_RO(ISRPREEMPT, 23, 1)
10104 // External interrupt pending flag
10105 ADD_BITFIELD_RO(ISRPENDING, 22, 1)
10106 // Indicates the exception number for the highest priority pending exception: 0 = no pending exceptions. Non zero = The pending state includes the effect of memory-mapped enable and mask registers. It does not include the PRIMASK special-purpose register qualifier.
10107 ADD_BITFIELD_RO(VECTPENDING, 12, 9)
10108 // Active exception number field. Reset clears the VECTACTIVE field.
10109 ADD_BITFIELD_RO(VECTACTIVE, 0, 9)
10110 END_TYPE()
10111
10112 // The VTOR holds the vector table offset address.
10113 // Reset value: 0x00000000
10114 BEGIN_TYPE(VTOR_t, uint32_t)
10115 // Bits [31:8] of the indicate the vector table offset address.
10116 ADD_BITFIELD_RW(TBLOFF, 8, 24)
10117 END_TYPE()
10118
10119 // Use the Application Interrupt and Reset Control Register to: determine data endianness, clear all active state information from debug halt mode, request a system reset.
10120 // Reset value: 0x00000000
10121 BEGIN_TYPE(AIRCR_t, uint32_t)
10122 // Register key:
10123 // Reads as Unknown
10124 // On writes, write 0x05FA to VECTKEY, otherwise the write is ignored.
10125 ADD_BITFIELD_RW(VECTKEY, 16, 16)
10126 // Data endianness implemented:
10127 // 0 = Little-endian.
10128 ADD_BITFIELD_RO(ENDIANESS, 15, 1)
10129 // Writing 1 to this bit causes the SYSRESETREQ signal to the outer system to be asserted to request a reset. The intention is to force a large system reset of all major components except for debug. The C_HALT bit in the DHCSR is cleared as a result of the system reset requested. The debugger does not lose contact with the device.
10130 ADD_BITFIELD_RW(SYSRESETREQ, 2, 1)
10131 // Clears all active state information for fixed and configurable exceptions. This bit: is self-clearing, can only be set by the DAP when the core is halted. When set: clears all active exception status of the processor, forces a return to Thread mode, forces an IPSR of 0. A debugger must re-initialize the stack.
10132 ADD_BITFIELD_RW(VECTCLRACTIVE, 1, 1)
10133 END_TYPE()
10134
10135 // System Control Register. Use the System Control Register for power-management functions: signal to the system when the processor can enter a low power state, control how the processor enters and exits low power states.
10136 // Reset value: 0x00000000
10137 BEGIN_TYPE(SCR_t, uint32_t)
10138 // Send Event on Pending bit:
10139 // 0 = Only enabled interrupts or events can wakeup the processor, disabled interrupts are excluded.
10140 // 1 = Enabled events and all interrupts, including disabled interrupts, can wakeup the processor.
10141 // When an event or interrupt becomes pending, the event signal wakes up the processor from WFE. If the
10142 // processor is not waiting for an event, the event is registered and affects the next WFE.
10143 // The processor also wakes up on execution of an SEV instruction or an external event.
10144 ADD_BITFIELD_RW(SEVONPEND, 4, 1)
10145 // Controls whether the processor uses sleep or deep sleep as its low power mode:
10146 // 0 = Sleep.
10147 // 1 = Deep sleep.
10148 ADD_BITFIELD_RW(SLEEPDEEP, 2, 1)
10149 // Indicates sleep-on-exit when returning from Handler mode to Thread mode:
10150 // 0 = Do not sleep when returning to Thread mode.
10151 // 1 = Enter sleep, or deep sleep, on return from an ISR to Thread mode.
10152 // Setting this bit to 1 enables an interrupt driven application to avoid returning to an empty main application.
10153 ADD_BITFIELD_RW(SLEEPONEXIT, 1, 1)
10154 END_TYPE()
10155
10156 // The Configuration and Control Register permanently enables stack alignment and causes unaligned accesses to result in a Hard Fault.
10157 // Reset value: 0x00000000
10158 BEGIN_TYPE(CCR_t, uint32_t)
10159 // Always reads as one, indicates 8-byte stack alignment on exception entry. On exception entry, the processor uses bit[9] of the stacked PSR to indicate the stack alignment. On return from the exception it uses this stacked bit to restore the correct stack alignment.
10160 ADD_BITFIELD_RO(STKALIGN, 9, 1)
10161 // Always reads as one, indicates that all unaligned accesses generate a HardFault.
10162 ADD_BITFIELD_RO(UNALIGN_TRP, 3, 1)
10163 END_TYPE()
10164
10165 // System handlers are a special class of exception handler that can have their priority set to any of the priority levels. Use the System Handler Priority Register 2 to set the priority of SVCall.
10166 // Reset value: 0x00000000
10167 BEGIN_TYPE(SHPR2_t, uint32_t)
10168 // Priority of system handler 11, SVCall
10169 ADD_BITFIELD_RW(PRI_11, 30, 2)
10170 END_TYPE()
10171
10172 // System handlers are a special class of exception handler that can have their priority set to any of the priority levels. Use the System Handler Priority Register 3 to set the priority of PendSV and SysTick.
10173 // Reset value: 0x00000000
10174 BEGIN_TYPE(SHPR3_t, uint32_t)
10175 // Priority of system handler 15, SysTick
10176 ADD_BITFIELD_RW(PRI_15, 30, 2)
10177 // Priority of system handler 14, PendSV
10178 ADD_BITFIELD_RW(PRI_14, 22, 2)
10179 END_TYPE()
10180
10181 // Use the System Handler Control and State Register to determine or clear the pending status of SVCall.
10182 // Reset value: 0x00000000
10183 BEGIN_TYPE(SHCSR_t, uint32_t)
10184 // Reads as 1 if SVCall is Pending. Write 1 to set pending SVCall, write 0 to clear pending SVCall.
10185 ADD_BITFIELD_RW(SVCALLPENDED, 15, 1)
10186 END_TYPE()
10187
10188 // Read the MPU Type Register to determine if the processor implements an MPU, and how many regions the MPU supports.
10189 // Reset value: 0x00000800
10190 BEGIN_TYPE(MPU_TYPE_t, uint32_t)
10191 // Instruction region. Reads as zero as ARMv6-M only supports a unified MPU.
10192 ADD_BITFIELD_RO(IREGION, 16, 8)
10193 // Number of regions supported by the MPU.
10194 ADD_BITFIELD_RO(DREGION, 8, 8)
10195 // Indicates support for separate instruction and data address maps. Reads as 0 as ARMv6-M only supports a unified MPU.
10196 ADD_BITFIELD_RO(SEPARATE, 0, 1)
10197 END_TYPE()
10198
10199 // Use the MPU Control Register to enable and disable the MPU, and to control whether the default memory map is enabled as a background region for privileged accesses, and whether the MPU is enabled for HardFaults and NMIs.
10200 // Reset value: 0x00000000
10201 BEGIN_TYPE(MPU_CTRL_t, uint32_t)
10202 // Controls whether the default memory map is enabled as a background region for privileged accesses. This bit is ignored when ENABLE is clear.
10203 // 0 = If the MPU is enabled, disables use of the default memory map. Any memory access to a location not
10204 // covered by any enabled region causes a fault.
10205 // 1 = If the MPU is enabled, enables use of the default memory map as a background region for privileged software accesses.
10206 // When enabled, the background region acts as if it is region number -1. Any region that is defined and enabled has priority over this default map.
10207 ADD_BITFIELD_RW(PRIVDEFENA, 2, 1)
10208 // Controls the use of the MPU for HardFaults and NMIs. Setting this bit when ENABLE is clear results in UNPREDICTABLE behaviour.
10209 // When the MPU is enabled:
10210 // 0 = MPU is disabled during HardFault and NMI handlers, regardless of the value of the ENABLE bit.
10211 // 1 = the MPU is enabled during HardFault and NMI handlers.
10212 ADD_BITFIELD_RW(HFNMIENA, 1, 1)
10213 // Enables the MPU. If the MPU is disabled, privileged and unprivileged accesses use the default memory map.
10214 // 0 = MPU disabled.
10215 // 1 = MPU enabled.
10216 ADD_BITFIELD_RW(ENABLE, 0, 1)
10217 END_TYPE()
10218
10219 // Use the MPU Region Number Register to select the region currently accessed by MPU_RBAR and MPU_RASR.
10220 // Reset value: 0x00000000
10221 BEGIN_TYPE(MPU_RNR_t, uint32_t)
10222 // Indicates the MPU region referenced by the MPU_RBAR and MPU_RASR registers.
10223 // The MPU supports 8 memory regions, so the permitted values of this field are 0-7.
10224 ADD_BITFIELD_RW(REGION, 0, 4)
10225 END_TYPE()
10226
10227 // Read the MPU Region Base Address Register to determine the base address of the region identified by MPU_RNR. Write to update the base address of said region or that of a specified region, with whose number MPU_RNR will also be updated.
10228 // Reset value: 0x00000000
10229 BEGIN_TYPE(MPU_RBAR_t, uint32_t)
10230 // Base address of the region.
10231 ADD_BITFIELD_RW(ADDR, 8, 24)
10232 // On writes, indicates whether the write must update the base address of the region identified by the REGION field, updating the MPU_RNR to indicate this new region.
10233 // Write:
10234 // 0 = MPU_RNR not changed, and the processor:
10235 // Updates the base address for the region specified in the MPU_RNR.
10236 // Ignores the value of the REGION field.
10237 // 1 = The processor:
10238 // Updates the value of the MPU_RNR to the value of the REGION field.
10239 // Updates the base address for the region specified in the REGION field.
10240 // Always reads as zero.
10241 ADD_BITFIELD_RW(VALID, 4, 1)
10242 // On writes, specifies the number of the region whose base address to update provided VALID is set written as 1. On reads, returns bits [3:0] of MPU_RNR.
10243 ADD_BITFIELD_RW(REGION, 0, 4)
10244 END_TYPE()
10245
10246 // Use the MPU Region Attribute and Size Register to define the size, access behaviour and memory type of the region identified by MPU_RNR, and enable that region.
10247 // Reset value: 0x00000000
10248 BEGIN_TYPE(MPU_RASR_t, uint32_t)
10249 // The MPU Region Attribute field. Use to define the region attribute control.
10250 // 28 = XN: Instruction access disable bit:
10251 // 0 = Instruction fetches enabled.
10252 // 1 = Instruction fetches disabled.
10253 // 26:24 = AP: Access permission field
10254 // 18 = S: Shareable bit
10255 // 17 = C: Cacheable bit
10256 // 16 = B: Bufferable bit
10257 ADD_BITFIELD_RW(ATTRS, 16, 16)
10258 // Subregion Disable. For regions of 256 bytes or larger, each bit of this field controls whether one of the eight equal subregions is enabled.
10259 ADD_BITFIELD_RW(SRD, 8, 8)
10260 // Indicates the region size. Region size in bytes = 2^(SIZE+1). The minimum permitted value is 7 (b00111) = 256Bytes
10261 ADD_BITFIELD_RW(SIZE, 1, 5)
10262 // Enables the region.
10263 ADD_BITFIELD_RW(ENABLE, 0, 1)
10264 END_TYPE()
10265
10266 struct PPB_t {
10267 uint32_t reserved0[14340];
10268 SYST_CSR_t SYST_CSR;
10269 SYST_RVR_t SYST_RVR;
10270 SYST_CVR_t SYST_CVR;
10271 SYST_CALIB_t SYST_CALIB;
10272 uint32_t reserved1[56];
10273 NVIC_ISER_t NVIC_ISER;
10274 uint32_t reserved2[31];
10275 NVIC_ICER_t NVIC_ICER;
10276 uint32_t reserved3[31];
10277 NVIC_ISPR_t NVIC_ISPR;
10278 uint32_t reserved4[31];
10279 NVIC_ICPR_t NVIC_ICPR;
10280 uint32_t reserved5[95];
10281 NVIC_IPR0_t NVIC_IPR0;
10282 NVIC_IPR1_t NVIC_IPR1;
10283 NVIC_IPR2_t NVIC_IPR2;
10284 NVIC_IPR3_t NVIC_IPR3;
10285 NVIC_IPR4_t NVIC_IPR4;
10286 NVIC_IPR5_t NVIC_IPR5;
10287 NVIC_IPR6_t NVIC_IPR6;
10288 NVIC_IPR7_t NVIC_IPR7;
10289 uint32_t reserved6[568];
10290 CPUID_t CPUID;
10291 ICSR_t ICSR;
10292 VTOR_t VTOR;
10293 AIRCR_t AIRCR;
10294 SCR_t SCR;
10295 CCR_t CCR;
10296 uint32_t reserved7;
10297 SHPR2_t SHPR2;
10298 SHPR3_t SHPR3;
10299 SHCSR_t SHCSR;
10300 uint32_t reserved8[26];
10301 MPU_TYPE_t MPU_TYPE;
10302 MPU_CTRL_t MPU_CTRL;
10303 MPU_RNR_t MPU_RNR;
10304 MPU_RBAR_t MPU_RBAR;
10305 MPU_RASR_t MPU_RASR;
10306 };
10307
10308 static PPB_t & PPB = (*(PPB_t *)0xe0000000);
10309
10310} // _PPB_
10311
Definition FIFO.h:9