21#ifndef LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32672_INCLUDE_MAX32672_H_
22#define LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32672_INCLUDE_MAX32672_H_
25#define TARGET_NUM 32672
50#define __weak __attribute__((weak))
53#elif defined(__CC_ARM)
55#define inline __inline
61 NonMaskableInt_IRQn = -14,
63 MemoryManagement_IRQn = -12,
65 UsageFault_IRQn = -10,
67 DebugMonitor_IRQn = -4,
188#define MXC_IRQ_COUNT (MXC_IRQ_EXT_COUNT + 16)
195#define __CM4_REV 0x0100
196#define __MPU_PRESENT 1
197#define __NVIC_PRIO_BITS 3
198#define __Vendor_SysTickConfig 0
199#define __FPU_PRESENT 1
202#include "system_max32672.h"
208#define MXC_ROM_MEM_BASE 0x00000000UL
209#define MXC_ROM_MEM_SIZE 0x00020000UL
210#define MXC_XIP_MEM_BASE 0x08000000UL
211#define MXC_XIP_MEM_SIZE 0x08000000UL
212#define MXC_FLASH0_MEM_BASE 0x10000000UL
213#define MXC_FLASH1_MEM_BASE 0x10080000UL
214#define MXC_FLASH_MEM_BASE MXC_FLASH0_MEM_BASE
215#define MXC_FLASH_PAGE_SIZE 0x00002000UL
216#define MXC_FLASH_MEM_SIZE 0x00080000UL
217#define MXC_INFO0_MEM_BASE 0x10800000UL
218#define MXC_INFO1_MEM_BASE 0x10802000UL
219#define MXC_INFO_MEM_BASE MXC_INFO0_MEM_BASE
220#define MXC_INFO_MEM_SIZE 0x00002000UL
221#define MXC_SRAM_MEM_BASE 0x20000000UL
222#define MXC_SRAM_MEM_SIZE 0x00032000UL
223#define MXC_XIP_DATA_MEM_BASE 0x80000000UL
224#define MXC_XIP_DATA_MEM_SIZE 0x20000000UL
236#define MXC_BASE_GCR ((uint32_t)0x40000000UL)
237#define MXC_GCR ((mxc_gcr_regs_t *)MXC_BASE_GCR)
241#define MXC_BASE_SIR ((uint32_t)0x40000400UL)
242#define MXC_SIR ((mxc_sir_regs_t *)MXC_BASE_SIR)
246#define MXC_BASE_FCR ((uint32_t)0x40000800UL)
247#define MXC_FCR ((mxc_fcr_regs_t *)MXC_BASE_FCR)
251#define MXC_BASE_CTB ((uint32_t)0x40001000UL)
252#define MXC_CTB ((mxc_ctb_regs_t *)MXC_BASE_CTB)
256#define MXC_BASE_TRIMSIR ((uint32_t)0x40105400UL)
257#define MXC_TRIMSIR ((mxc_trimsir_regs_t *)MXC_BASE_TRIMSIR)
260#define MXC_ECC ((mxc_ecc_regs_t *)MXC_BASE_TRIMSIR)
264#define MXC_BASE_WDT0 ((uint32_t)0x40003000UL)
265#define MXC_WDT0 ((mxc_wdt_regs_t *)MXC_BASE_WDT0)
266#define MXC_BASE_WDT1 ((uint32_t)0x40003400UL)
267#define MXC_WDT1 ((mxc_wdt_regs_t *)MXC_BASE_WDT1)
271#define MXC_BASE_SYS_AESKEYS ((uint32_t)0x40205000UL)
272#define MXC_SYS_AESKEYS ((mxc_sys_aeskeys_regs_t *)MXC_BASE_SYS_AESKEYS)
274#define MXC_BASE_USR_AESKEYS ((uint32_t)0x40005000UL)
275#define MXC_USR_AESKEYS ((mxc_usr_aeskeys_regs_t *)MXC_BASE_USR_AESKEYS)
280#define MXC_BASE_AESKEY MXC_BASE_SYS_AESKEYS
285#define MXC_AESKEY ((mxc_aes_key_regs_t *)MXC_BASE_SYS_AESKEY)
290#define MXC_BASE_AESKEYS MXC_BASE_SYS_AESKEYS
295#define MXC_AESKEYS MXC_SYS_AESKEYS
299#define MXC_BASE_RTC ((uint32_t)0x40106000UL)
300#define MXC_RTC ((mxc_rtc_regs_t *)MXC_BASE_RTC)
304#define MXC_BASE_PWRSEQ ((uint32_t)0x40106800UL)
305#define MXC_PWRSEQ ((mxc_pwrseq_regs_t *)MXC_BASE_PWRSEQ)
309#define MXC_BASE_MCR ((uint32_t)0x40106C00UL)
310#define MXC_MCR ((mxc_mcr_regs_t *)MXC_BASE_MCR)
314#define MXC_BASE_AES ((uint32_t)0x40207400UL)
315#define MXC_AES ((mxc_aes_regs_t *)MXC_BASE_AES)
318typedef __attribute__((deprecated(
319 "Use MXC_AES (mxc_aes_regs_t), not the deprecated MXC_SYS_AES (mxc_sys_aes_regs_t) instance name and struct. 10-24-2022")))
321#define MXC_SYS_AES ((mxc_sys_aes_regs_t *)MXC_BASE_AES)
325#define MXC_CFG_GPIO_INSTANCES (3)
326#define MXC_CFG_GPIO_PINS_PORT (32)
328#define MXC_BASE_GPIO0 ((uint32_t)0x40008000UL)
329#define MXC_GPIO0 ((mxc_gpio_regs_t *)MXC_BASE_GPIO0)
330#define MXC_BASE_GPIO1 ((uint32_t)0x40009000UL)
331#define MXC_GPIO1 ((mxc_gpio_regs_t *)MXC_BASE_GPIO1)
333#define MXC_GPIO_GET_IDX(p) ((p) == MXC_GPIO0 ? 0 : (p) == MXC_GPIO1 ? 1 : -1)
335#define MXC_GPIO_GET_GPIO(i) ((i) == 0 ? MXC_GPIO0 : (i) == 1 ? MXC_GPIO1 : 0)
337#define MXC_GPIO_GET_IRQ(i) ((i) == 0 ? GPIO0_IRQn : (i) == 1 ? GPIO1_IRQn : 0)
341#define MXC_BASE_CRC ((uint32_t)0x4000F000UL)
342#define MXC_CRC ((mxc_crc_regs_t *)MXC_BASE_CRC)
346#define SEC(s) (((uint32_t)s) * 1000000UL)
347#define MSEC(ms) (ms * 1000UL)
350#define MXC_CFG_TMR_INSTANCES (6)
352#define MXC_BASE_TMR0 ((uint32_t)0x40010000UL)
353#define MXC_TMR0 ((mxc_tmr_regs_t *)MXC_BASE_TMR0)
354#define MXC_BASE_TMR1 ((uint32_t)0x40011000UL)
355#define MXC_TMR1 ((mxc_tmr_regs_t *)MXC_BASE_TMR1)
356#define MXC_BASE_TMR2 ((uint32_t)0x40012000UL)
357#define MXC_TMR2 ((mxc_tmr_regs_t *)MXC_BASE_TMR2)
358#define MXC_BASE_TMR3 ((uint32_t)0x40013000UL)
359#define MXC_TMR3 ((mxc_tmr_regs_t *)MXC_BASE_TMR3)
360#define MXC_BASE_TMR4 ((uint32_t)0x40114000UL)
361#define MXC_TMR4 ((mxc_tmr_regs_t *)MXC_BASE_TMR4)
362#define MXC_BASE_TMR5 ((uint32_t)0x40115000UL)
363#define MXC_TMR5 ((mxc_tmr_regs_t *)MXC_BASE_TMR5)
365#define MXC_TMR_GET_IRQ(i) \
366 (IRQn_Type)((i) == 0 ? TMR0_IRQn : \
367 (i) == 1 ? TMR1_IRQn : \
368 (i) == 2 ? TMR2_IRQn : \
369 (i) == 3 ? TMR3_IRQn : \
370 (i) == 4 ? TMR4_IRQn : \
371 (i) == 5 ? TMR5_IRQn : \
374#define MXC_TMR_GET_BASE(i) \
375 ((i) == 0 ? MXC_BASE_TMR0 : \
376 (i) == 1 ? MXC_BASE_TMR1 : \
377 (i) == 2 ? MXC_BASE_TMR2 : \
378 (i) == 3 ? MXC_BASE_TMR3 : \
379 (i) == 4 ? MXC_BASE_TMR4 : \
380 (i) == 5 ? MXC_BASE_TMR5 : \
383#define MXC_TMR_GET_TMR(i) \
384 ((i) == 0 ? MXC_TMR0 : \
385 (i) == 1 ? MXC_TMR1 : \
386 (i) == 2 ? MXC_TMR2 : \
387 (i) == 3 ? MXC_TMR3 : \
388 (i) == 4 ? MXC_TMR4 : \
389 (i) == 5 ? MXC_TMR5 : \
392#define MXC_TMR_GET_IDX(p) \
393 ((p) == MXC_TMR0 ? 0 : \
394 (p) == MXC_TMR1 ? 1 : \
395 (p) == MXC_TMR2 ? 2 : \
396 (p) == MXC_TMR3 ? 3 : \
397 (p) == MXC_TMR4 ? 4 : \
398 (p) == MXC_TMR5 ? 5 : \
403#define MXC_I2C_INSTANCES (3)
404#define MXC_I2C_NUM_TARGET_ADDR (4)
405#define MXC_I2C_FIFO_DEPTH (8)
407#define MXC_BASE_I2C0 ((uint32_t)0x4001D000UL)
408#define MXC_I2C0 ((mxc_i2c_regs_t *)MXC_BASE_I2C0)
409#define MXC_BASE_I2C1 ((uint32_t)0x4001E000UL)
410#define MXC_I2C1 ((mxc_i2c_regs_t *)MXC_BASE_I2C1)
411#define MXC_BASE_I2C2 ((uint32_t)0x4001F000UL)
412#define MXC_I2C2 ((mxc_i2c_regs_t *)MXC_BASE_I2C2)
414#define MXC_I2C_GET_IRQ(i) \
415 (IRQn_Type)((i) == 0 ? I2C0_IRQn : (i) == 1 ? I2C1_IRQn : (i) == 2 ? I2C2_IRQn : 0)
417#define MXC_I2C_GET_BASE(i) \
418 ((i) == 0 ? MXC_BASE_I2C0 : (i) == 1 ? MXC_BASE_I2C1 : (i) == 2 ? MXC_BASE_I2C2 : 0)
420#define MXC_I2C_GET_I2C(i) ((i) == 0 ? MXC_I2C0 : (i) == 1 ? MXC_I2C1 : (i) == 2 ? MXC_I2C2 : 0)
422#define MXC_I2C_GET_IDX(p) ((p) == MXC_I2C0 ? 0 : (p) == MXC_I2C1 ? 1 : (p) == MXC_I2C2 ? 2 : -1)
426#define MXC_DMA_CHANNELS (12)
427#define MXC_DMA_INSTANCES (1)
429#define MXC_BASE_DMA ((uint32_t)0x40028000UL)
430#define MXC_DMA ((mxc_dma_regs_t *)MXC_BASE_DMA)
432#define MXC_DMA_GET_IDX(p) ((p) == MXC_DMA ? 0 : -1)
434#define MXC_DMA_CH_GET_IRQ(i) \
435 ((IRQn_Type)(((i) == 0) ? DMA0_IRQn : \
436 ((i) == 1) ? DMA1_IRQn : \
437 ((i) == 2) ? DMA2_IRQn : \
438 ((i) == 3) ? DMA3_IRQn : \
439 ((i) == 4) ? DMA4_IRQn : \
440 ((i) == 5) ? DMA5_IRQn : \
441 ((i) == 6) ? DMA6_IRQn : \
442 ((i) == 7) ? DMA7_IRQn : \
443 ((i) == 8) ? DMA8_IRQn : \
444 ((i) == 9) ? DMA9_IRQn : \
445 ((i) == 10) ? DMA10_IRQn : \
446 ((i) == 11) ? DMA11_IRQn : \
451#define MXC_FLC_INSTANCES (2)
453#define MXC_BASE_FLC0 ((uint32_t)0x40029000UL)
454#define MXC_FLC0 ((mxc_flc_regs_t *)MXC_BASE_FLC0)
455#define MXC_BASE_FLC1 ((uint32_t)0x40029400UL)
456#define MXC_FLC1 ((mxc_flc_regs_t *)MXC_BASE_FLC1)
458#define MXC_FLC_GET_IRQ(i) (IRQn_Type)((i) == 0 ? FLC0_IRQn : \
459 (i) == 1 ? FLC1_IRQn 0)
461#define MXC_FLC_GET_BASE(i) ((i) == 0 ? MXC_BASE_FLC0 : (i) == 1 ? MXC_BASE_FLC1 : 0)
463#define MXC_FLC_GET_FLC(i) ((i) == 0 ? MXC_FLC0 : (i) == 1 ? MXC_FLC1 : 0)
465#define MXC_FLC_GET_IDX(p) ((p) == MXC_FLC0 ? 0 : (p) == MXC_FLC1 ? 1 : -1)
469#define MXC_BASE_ICC ((uint32_t)0x4002A000UL)
470#define MXC_ICC ((mxc_icc_regs_t *)MXC_BASE_ICC)
474#define MXC_BASE_ADC ((uint32_t)0x40034000UL)
475#define MXC_ADC ((mxc_adc_regs_t *)MXC_BASE_ADC)
479#define MXC_BASE_OWM ((uint32_t)0x4003D000UL)
480#define MXC_OWM ((mxc_owm_regs_t *)MXC_BASE_OWM)
484#define MXC_UART_INSTANCES (4)
485#define MXC_UART_FIFO_DEPTH (8)
487#define MXC_BASE_UART0 ((uint32_t)0x40042000UL)
488#define MXC_UART0 ((mxc_uart_regs_t *)MXC_BASE_UART0)
489#define MXC_BASE_UART1 ((uint32_t)0x40043000UL)
490#define MXC_UART1 ((mxc_uart_regs_t *)MXC_BASE_UART1)
491#define MXC_BASE_UART2 ((uint32_t)0x40044000UL)
492#define MXC_UART2 ((mxc_uart_regs_t *)MXC_BASE_UART2)
493#define MXC_BASE_UART3 ((uint32_t)0x40145000UL)
494#define MXC_UART3 ((mxc_uart_regs_t *)MXC_BASE_UART3)
496#define MXC_UART_GET_IRQ(i) \
497 (IRQn_Type)((i) == 0 ? UART0_IRQn : \
498 (i) == 1 ? UART1_IRQn : \
499 (i) == 2 ? UART2_IRQn : \
500 (i) == 3 ? UART3_IRQn : \
503#define MXC_UART_GET_BASE(i) \
504 ((i) == 0 ? MXC_BASE_UART0 : \
505 (i) == 1 ? MXC_BASE_UART1 : \
506 (i) == 2 ? MXC_BASE_UART2 : \
507 (i) == 3 ? MXC_BASE_UART3 : \
510#define MXC_UART_GET_UART(i) \
511 ((i) == 0 ? MXC_UART0 : (i) == 1 ? MXC_UART1 : (i) == 2 ? MXC_UART2 : (i) == 3 ? MXC_UART3 : 0)
513#define MXC_UART_GET_IDX(p) \
514 ((p) == MXC_UART0 ? 0 : (p) == MXC_UART1 ? 1 : (p) == MXC_UART2 ? 2 : (p) == MXC_UART3 ? 3 : -1)
518#define MXC_SPI_INSTANCES (3)
519#define MXC_SPI_SS_INSTANCES (4)
520#define MXC_SPI_FIFO_DEPTH (32)
522#define MXC_BASE_SPI0 ((uint32_t)0x40046000UL)
523#define MXC_SPI0 ((mxc_spi_regs_t *)MXC_BASE_SPI0)
524#define MXC_BASE_SPI1 ((uint32_t)0x40047000UL)
525#define MXC_SPI1 ((mxc_spi_regs_t *)MXC_BASE_SPI1)
526#define MXC_BASE_SPI2 ((uint32_t)0x40048000UL)
527#define MXC_SPI2 ((mxc_spi_regs_t *)MXC_BASE_SPI2)
529#define MXC_SPI_GET_IDX(p) ((p) == MXC_SPI0 ? 0 : (p) == MXC_SPI1 ? 1 : (p) == MXC_SPI2 ? 2 : -1)
531#define MXC_SPI_GET_BASE(i) \
532 ((i) == 0 ? MXC_BASE_SPI0 : (i) == 1 ? MXC_BASE_SPI1 : (i) == 2 ? MXC_BASE_SPI2 : 0)
534#define MXC_SPI_GET_SPI(i) ((i) == 0 ? MXC_SPI0 : (i) == 1 ? MXC_SPI1 : (i) == 2 ? MXC_SPI2 : 0)
536#define MXC_SPI_GET_IRQ(i) \
537 (IRQn_Type)((i) == 0 ? SPI0_IRQn : (i) == 1 ? SPI1_IRQn : (i) == 2 ? SPI2_IRQn : 0)
541#define MXC_BASE_TRNG ((uint32_t)0x4004D000UL)
542#define MXC_TRNG ((mxc_trng_regs_t *)MXC_BASE_TRNG)
545#define MXC_BASE_I2S ((uint32_t)0x40060000UL)
546#define MXC_I2S ((mxc_i2s_regs_t *)MXC_BASE_I2S)
550#define MXC_BASE_QDEC ((uint32_t)0x40063000UL)
551#define MXC_QDEC ((mxc_qdec_regs_t *)MXC_BASE_QDEC)
555#define MXC_F_BIT_0 (1 << 0)
556#define MXC_F_BIT_1 (1 << 1)
557#define MXC_F_BIT_2 (1 << 2)
558#define MXC_F_BIT_3 (1 << 3)
559#define MXC_F_BIT_4 (1 << 4)
560#define MXC_F_BIT_5 (1 << 5)
561#define MXC_F_BIT_6 (1 << 6)
562#define MXC_F_BIT_7 (1 << 7)
563#define MXC_F_BIT_8 (1 << 8)
564#define MXC_F_BIT_9 (1 << 9)
565#define MXC_F_BIT_10 (1 << 10)
566#define MXC_F_BIT_11 (1 << 11)
567#define MXC_F_BIT_12 (1 << 12)
568#define MXC_F_BIT_13 (1 << 13)
569#define MXC_F_BIT_14 (1 << 14)
570#define MXC_F_BIT_15 (1 << 15)
571#define MXC_F_BIT_16 (1 << 16)
572#define MXC_F_BIT_17 (1 << 17)
573#define MXC_F_BIT_18 (1 << 18)
574#define MXC_F_BIT_19 (1 << 19)
575#define MXC_F_BIT_20 (1 << 20)
576#define MXC_F_BIT_21 (1 << 21)
577#define MXC_F_BIT_22 (1 << 22)
578#define MXC_F_BIT_23 (1 << 23)
579#define MXC_F_BIT_24 (1 << 24)
580#define MXC_F_BIT_25 (1 << 25)
581#define MXC_F_BIT_26 (1 << 26)
582#define MXC_F_BIT_27 (1 << 27)
583#define MXC_F_BIT_28 (1 << 28)
584#define MXC_F_BIT_29 (1 << 29)
585#define MXC_F_BIT_30 (1 << 30)
586#define MXC_F_BIT_31 (1 << 31)
590#define BITBAND(reg, bit) \
591 ((0xf0000000 & (uint32_t)(reg)) + 0x2000000 + (((uint32_t)(reg)&0x0fffffff) << 5) + \
594#define MXC_CLRBIT(reg, bit) (*(volatile uint32_t *)BITBAND(reg, bit) = 0)
595#define MXC_SETBIT(reg, bit) (*(volatile uint32_t *)BITBAND(reg, bit) = 1)
596#define MXC_GETBIT(reg, bit) (*(volatile uint32_t *)BITBAND(reg, bit))
598#define MXC_SETFIELD(reg, mask, setting) (reg = ((reg) & ~(mask)) | ((setting) & (mask)))
604#define SCB_CPACR_CP10_Pos 20
605#define SCB_CPACR_CP10_Msk (0x3UL << SCB_CPACR_CP10_Pos)
606#define SCB_CPACR_CP11_Pos 22
607#define SCB_CPACR_CP11_Msk (0x3UL << SCB_CPACR_CP11_Pos)
Registers, Bit Masks and Bit Positions for the AES Peripheral Module.
Definition: aes_regs.h:76
Registers, Bit Masks and Bit Positions for the TRIMSIR Peripheral Module.